This section introductes how to sync with the upstream repository after fork.
Use git remote -v
to check current remote repository
origin git@github.com:<address of your remote repository> (fetch)
origin git@github.com:<address of your remote repository> (push)
Run the following command line to add an upstream address, pointing to the origional address of the repository you forked.
git remote add upstream <address of upstream repository>
git remote -v will output:
origin git@github.com:<address of your remote repository> (fetch)
origin git@github.com:<address of your remote repository> (push)
upstream <address of upstream repository> (fetch)
upstream <address of upstream repository> (push)
Run the folloing command to sync with upstream
git fetch upstream
git checkout master
git merge upstream/master
Finish up with:
git push origin master