Skip to content

Instantly share code, notes, and snippets.

@AMZN-alexpete
Created April 6, 2022 21:05
Show Gist options
  • Select an option

  • Save AMZN-alexpete/4fb03aed23fc2b0ce96bc335c92cbb48 to your computer and use it in GitHub Desktop.

Select an option

Save AMZN-alexpete/4fb03aed23fc2b0ce96bc335c92cbb48 to your computer and use it in GitHub Desktop.
Typical Git (O3DE) Setup

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:

  1. Clone the origin repository which is usually a fork where a team does work before merging it into the main upstream repository
λ git clone https://github.com/aws-lumberyard-dev/o3de.git
λ cd o3de
  1. Add the upstream, which is the main repository
λ git remote add upstream https://github.com/o3de/o3de.git
  1. Prevent pushing to the upstream
λ git remote set-url --push upstream push_not_allowed
  1. Add an alias named fork for 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
  1. 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment