-
StackOverflow 文件
-
github 教程
-
更新分叉的儲存庫
-
為你的分支配置一個遠端,然後同步你的分支(主分支)
- 為我的前叉配置一個遙控器
$ cd my_local_repo
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
# Specify a new remote upstream repository that will be synced with the fork
$ git remote -v
# Verify the new upstream repository specified for my fork
- 在本地同步我的分叉
$ cd my_local_repo
$ git fetch upstream
# Fetch the branches and their respective commits from the upstream repository
# Commits to master will be stored in a local branch, upstream/master
$ git checkout master
$ git merge upstream/master
# Merge the changes from upstream/master into your local master branch
# brings your fork's master branch into sync with the upstream repo
- 在 Github 上同步我的 fork
$ git push origin master