如何更新github forked project? ( how to update the forked project on github? )

访问量: 3374

非常简单,就是在配置文件中增加一个 remote 。。。

# 增加一个remote, 起名叫  "upstream" (  Add the remote, call it "upstream":  )

git remote add upstream git://github.com/whoever/whatever.git

# 然后fetch 过来。。。
# Fetch all the branches of that remote into remote-tracking branches,
# such as upstream/master:

git fetch upstream

# 然后把它合并到本地的master上: 
# 1. checkout master   ( Make sure that you're on your master branch: )

git checkout master

# 2. 执行rebase.  ( Rewrite your master branch so that any commits of yours that
# aren't already in upstream/master are replayed on top of that other branch:  )

git rebase upstream/master

refer to How to update GitHub forked repository?

订阅/RSS Feed

Subscribe