克隆了分叉存储库后,转到克隆所在的目录路径和Git Bash终端中的几行。
$ cd project-name
$ git remote add upstream https://github.com/user-name/project-name.git
# Adding the upstream -> the main repo with which you wanna sync
$ git remote -v # you will see the upstream here
$ git checkout master # see if you are already on master branch
$ git fetch upstream
“fetch”命令对于在项目中保持最新状态是必不可少的:只有在执行“git fetch”时,才会通知您同事推送到远程服务器的更改。
你还可以去
here
供进一步查询