打开终端终端Git Bash。
列出当前为复刻配置的远程仓库。
$ git remote -v > origin https://.com/YOUR-USERNAME/YOUR-FORK.git (fetch) > origin https://.com/YOUR-USERNAME/YOUR-FORK.git (push)
指定将与分支同步的新远程上游存储库。
git remote add upstream https://.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git
验证为复刻指定的新上游仓库。
$ git remote -v > origin https://.com/YOUR-USERNAME/YOUR-FORK.git (fetch) > origin https://.com/YOUR-USERNAME/YOUR-FORK.git (push) > upstream https://.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (fetch) > upstream https://.com/ORIGINAL-OWNER/ORIGINAL-REPOSITORY.git (push)