Setting up a git fork

I can never remember how to do this, so here, in a few lines is how to correctly set up a git fork to allow you to contribute to other people’s code

  1. At github fork the repository you are interested in. Sure, you can probably do this in the CLI, but why? In this example I am forking Bas Dutilh’s CAT repository
  2. clone your new fork somewhere to a CLI
  3. Set the upstream remote:
    • git remote add upstream https://github.com/dutilh/CAT.git
  4. Pull any changes since you did the fork (hopefully there aren’t any, but who knows)
    • git pull upstream master
  5. Push those to your branch
    • git push origin master
  6. Now maybe make a new branch to work on. This is just cleaner for later!
    • git checkout -b rob