3.1. Sync - shinokada/gitnotes GitHub Wiki

Fork a repo

Fork a repo to your git/bitbucket.

Clone it.

$ git clone https://github.com/YOUR-USERNAME/Spoon-Knife

Find the current config.

$ git remote -v
# origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
# origin  https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)

Add a remote as upstream

$ git remote add upstream https://github.com/octocat/Spoon-Knife.git

Check the config again.

$ git remote -v
# origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
# origin    https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
# upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
# upstream  https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)

Sync the upstream

$ git fetch upstream

If you are in a branch checkout to master

$ git checkout master

Merge it.

$ git merge upstream/master
⚠️ **GitHub.com Fallback** ⚠️