Skip to content

AZSLc Github Workflow

galibzon edited this page Mar 24, 2022 · 6 revisions

The main repo is hosted in https://github.com/o3de/o3de-azslc.git. This will be the upstream remote.
Your pull requests should be submitted to https://github.com/aws-lumberyard-dev/o3de-azslc.git. This will be the origin remote.

Cloning the code.

The following instructions assume the code will be cloned into a local directory called ~/GIT/.

$ cd ~/GIT
$ git clone https://github.com/aws-lumberyard-dev/o3de-azslc.git
$ cd o3de-azslc

Checking the current remote:

$ git remote -vv
origin  https://github.com/aws-lumberyard-dev/o3de-azslc.git (fetch)
origin  https://github.com/aws-lumberyard-dev/o3de-azslc.git (push)

The origin remote is good to go.

Let's add the upstream remote:

$ git remote add upstream https://github.com/o3de/o3de-azslc.git
$ git fetch upstream
$ git remote -vv
origin  https://github.com/aws-lumberyard-dev/o3de-azslc.git (fetch)
origin  https://github.com/aws-lumberyard-dev/o3de-azslc.git (push)
upstream        https://github.com/o3de/o3de-azslc.git (fetch)
upstream        https://github.com/o3de/o3de-azslc.git (push)

It's always a good idea to prevent from pushing code to the upstream remote:

$ git remote set-url --push upstream push_not_allowed
$ git remote -vv
origin  https://github.com/aws-lumberyard-dev/o3de-azslc.git (fetch)
origin  https://github.com/aws-lumberyard-dev/o3de-azslc.git (push)
upstream        https://github.com/o3de/o3de-azslc.git (fetch)
upstream        push_not_allowed (push)

Working With The development Branch

Finally, let's checkout the development branch directly from the upstream remote, make changes and submit a pull request.

Initially, the development branch is pointing to origin/development, but We need it to point to upstream/development

$ git branch -vv
* development bafacbe [origin/development] Minor fixes before open source publication
$ git branch -m development removeme
$ git branch -vv
* removeme bafacbe [origin/development] Minor fixes before open source publication
$ git checkout -b development upstream/development
Switched to a new branch 'development'
Branch 'development' set up to track remote branch 'development' from 'upstream'.
$ git branch -vv
* development ec7e239 [upstream/development] Improved project generation and compilation for Linux. (#23)
  removeme    bafacbe [origin/development] Minor fixes before open source publication
$ git branch -D removeme    
$ git branch -vv
* development ec7e239 [upstream/development] Improved project generation and compilation for Linux. (#23)

Code is properly checked out.

Before making changes, let's create a topic branch that we'll use later to submit our first pull request.

$ git checkout -b MyTopic
$ git branch -vv
* MyTopic     ec7e239 Improved project generation and compilation for Linux. (#23)
  development ec7e239 [upstream/development] Improved project generation and compilation for Linux. (#23)

Make some changes to the code.

... Making changes ...

Always commit with a signature and push the MyTopic branch to the origin remote.

$ git commit --signoff
$ git push -u origin MyTopic
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 64 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 324 bytes | 324.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote:
remote: Create a pull request for 'MyTopic' on GitHub by visiting:
remote:      https://github.com/aws-lumberyard-dev/o3de-azslc/pull/new/MyTopic
remote:
To https://github.com/aws-lumberyard-dev/o3de-azslc.git
 * [new branch]      MyTopic -> MyTopic
Branch 'MyTopic' set up to track remote branch 'MyTopic' from 'origin'.

As you can see, the push command gives you the link where you can create a pull request:

https://github.com/aws-lumberyard-dev/o3de-azslc/pull/new/MyTopic

For Reviewers always add o3de/sig-graphics-audio.