Merging an Upstream Repo into Your Fork


In recent years I’ve changed my approach to GIT version control to use a forking method vs. branching. While I still create branches, sometimes a lot of branches, where I create those branches has changed.

Let’s say for example that I’m working on a team of 5 developers creating features and making magic with software. We’re all working on different tasks and using feature branches to manage everything. That works fine most of the time, but it can get messy real quick. So I’ve moved to a forking method that works well, though it does require some additional management to keep everything up to date.

  1. In your terminal, change directory to your project
    cd /working/directory/of/project
  2. Checkout branch that you want to merge into, ex: master
    git checkout master
  3. Pull the upstream (parent of your fork)
    git pull upstream master
  4. Deal with any merge conflict, review any changes
  5. Update your fork with the new changes
    git push origin master