Skip to content

Set Up Github Forks

OmniBlade edited this page Apr 24, 2020 · 1 revision

Before you write any code, you will need to get a local copy of the source code to work with. The first step in preparing for this is setting up and cloning a Github repository fork.

Working With Forks

  1. Get a Github account. This is pretty fundamental to our preferred work flow. Head to Github and sign up for an account. If you really have issues with doing this but still want to contribute then contact one of the main contributors to discuss what other options we might entertain.

  2. Log in to Github and fork the repo you want to commit to. If you are unsure of how to do this, then github has a guide that you can follow to practice first.

  3. Clone your fork to your local machine using git. For Thyme your command will look something like this:
    git clone https://github.com/username/Thyme.git

  4. Recursively clone the submodules the project uses if any. You will need to change into the directory you just cloned to do this with something like the following command:
    git submodule update --init --recursive

Adding Remotes

  1. You should add at least the main repository as an alternative remote. This will allow you to use git to download changes made to the main repository to merge or rebase onto as required to keep your own code base up to date. The command looks like this to add a remote with the name "upstream":
    git remote add upstream https://github.com/TheAssemblyArmada/Thyme.git
    If you are collaborating with other developers on a branch or want to test another contributors branch, you can add their forks as additional remotes.

  2. By default you will start with the "develop" branch checked out for most of our projects, some only have a master branch if they are small libraries and in those cases you will start on the master branch. To make sure you have the latest version of the main branch that contributions will be merged into, use the following command to pull code from the upstream remote:
    git pull upstream develop
    This example will pull in any changes to the develop branch.