Typical GitHub repository setup consists of at least two repositories, the upstream and the fork. Sometimes a third personal repository can also be useful. Here's how I typically name and setup my Git remote repositories:
- Clone the
originrepository which is usually a fork where a team does work before merging it into the mainupstreamrepository
λ git clone https://github.com/aws-lumberyard-dev/o3de.git
λ cd o3de
- Add the upstream, which is the main repository
λ git remote add upstream https://github.com/o3de/o3de.git
- Prevent pushing to the upstream
λ git remote set-url --push upstream push_not_allowed
- Add an alias named
forkfor the origin repository (or team-fork or personal-fork) in case you forget what origin means
λ git remote add fork https://github.com/aws-lumberyard-dev/o3de.git
- Add a remote for a personal fork
λ git remote add personal-fork https://github.com/AMZN-alexpete/o3de.git
Final remote list
λ git remote -v
fork https://github.com/aws-lumberyard-dev/o3de.git (fetch)
fork https://github.com/aws-lumberyard-dev/o3de.git (push)
origin https://github.com/aws-lumberyard-dev/o3de.git (fetch)
origin https://github.com/aws-lumberyard-dev/o3de.git (push)
personal-fork https://github.com/amzn-alexpete/o3de.git (fetch)
personal-fork https://github.com/amzn-alexpete/o3de.git (push)
upstream https://github.com/o3de/o3de.git (fetch)
upstream push_not_allowed (push)