Skip to content

Set Up Github Forks

OmniBlade edited this page Feb 12, 2021 · 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. This guide assumes you are using a command line git client. If you are using a GUI client please refer to its documentation.

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 Vanilla-Conquer your command will look something like this:
    git clone https://github.com/username/Vanilla-Conquer.git

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/Vanilla-Conquer.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 "vanilla" branch checked out. On most other projects you will start with either a master or develop 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 vanilla --rebase
    This example will pull in any changes to the vanilla branch and ensure that any changes you have made are applied on top rather than creating what is called a "merge" commit.