Skip to content

Instantly share code, notes, and snippets.

@nkpgardose
Created July 6, 2016 02:12
Show Gist options
  • Save nkpgardose/0463435944d69bda518486a12739e17d to your computer and use it in GitHub Desktop.
Save nkpgardose/0463435944d69bda518486a12739e17d to your computer and use it in GitHub Desktop.
Syncing your forked repository from the orignal repository
  1. To sync your repository, first you must have a pointer from the original repository. Let's call it upstream
$ git remote -v # List all remote repository from your fork
$ git remote add upstream [https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git]

Let us say the original repository is https://github.com/google/material-design-lite

  1. Next, fetch the upstream branch
$ git fetch upstream
  1. Checkout to your master branch and sync your master to the original master repo
$ git checkout master
$ git merge upstream/master
  1. Checkout to your working branch and sync that with your new master
$ git checkout [working-branch]
$ git rebase master # NOTE: It may causes conflicts

¯\_(ツ)_/¯

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