Skip to content

How to fork the boilerplate and sync the fork with the original repository

Aldo edited this page Mar 14, 2018 · 3 revisions

This guide is based on: https://help.github.com/articles/syncing-a-fork and https://help.github.com/articles/configuring-a-remote-for-a-fork.

  1. Go to the RESCORM repository https://github.com/agordillo/RESCORM, and fork it with your GitHub user using the web interface.

  2. Open a terminal and clone the fork in your working directory.

git clone git@github.com:username/RESCORM.git
  1. Enter in the fork and add a remote pointing to the original RESCORM repository.
cd RESCORM/
git remote add upstream https://github.com/agordillo/RESCORM.git

From now on, the following commands can be executed in order to bring the changes from the official repository to your repository:

  1. Fetch changes from agordillo/RESCORM:
git fetch upstream

From https://github.com/agordillo/RESCORM  
[new branch]      master     -> upstream/master  
[new branch]      otherBranch -> upstream/otherBranch

Now, you have all the updates in upstream/#{branchName}.
The stable version is in upstream/master.

  1. Go to your local master branch (if you are not)
git checkout master
  1. Finally, merge the changes from upstream/master into your local master branch. This brings your fork's master branch into sync with the upstream repository, without losing your local changes.
git merge upstream/master