Skip to content

Instantly share code, notes, and snippets.

@gobinathm
Created October 16, 2015 20:45
Show Gist options
  • Save gobinathm/df2e23ceb509d5ba19cf to your computer and use it in GitHub Desktop.
Save gobinathm/df2e23ceb509d5ba19cf to your computer and use it in GitHub Desktop.
Keep For Updated

Keep A GitHub Fork Updated

Overview

Steps to keep a forked Github Repo Up-to-date.

Local Clone

After the forking, clone the repo in to your local system

git clone git@github.com:gobinathm/toolbar.git

gobinathm/toolbar.git would be your repository name

Upstream Setup

In your local repo, Add a remote, call it "upstream":

git remote add upstream https://github.com/paulkinzett/toolbar.git

Fetch & Merge

Now its time to fetch all branches of that remote into remote-tracking branches, ie., such as upstream/master:

git fetch upstream

Next step is to ensure we are in the write working branch

git checkout master	

Now its time to bring all those changes from remote into our branch & rewrite master branch so any commits that aren't part of upstream/master are replayed on top

git rebase upstream/master

Alternative: You can merget upsream/master into your master

git merge upstream/master

And more?

Follow @gobinathm on Twitter for more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment