列出远程仓库 URL
$ git remote -v
List the current remotes (列出当前远程仓库)
添加上游仓库URL
$ git remote add upstream
https://github.com/otheruser/repo.gitSet a new remote (设置一个新的远程仓库)
再次列出远程仓库 URL
$ git remote -v
Verify new remote (验证新的原唱仓库)
获取上游代码
$ git fetch upstream
检查你的 fork’s 本地 master 分支,如果不在master 分支就切换到该分支
$ git checkout master
Switched to branch ‘master’
合并来自 upstream/master 的更改到本地 master 分支上。
$ git merge upstream/master