我分叉了一个项目,应用了几个修复程序,并创建了一个可接受的提取请求。几天后,另一个贡献者做了另一个改变。所以我的叉子不包括这个变化。8 A3 |3 P* @" a9 h+ s
我怎样才能把零钱放在叉子里?当我有进一步的改变来做出贡献时,是否需要删除和重建我的分叉?还是有更新按钮? 5 M1 Z- L0 m8 F* g / {# Q% Q$ r' x. J- {解决方案: 5 p, p! D" u; ^7 w e+ R 在分叉存储库的本地克隆中,您可以使用原始 GitHub 存储库被添加到远程中。(远程就像存储 URL 的昵称 -origin例如,它是一个。)然后你可以从上游存储库中获得所有的分支,并重新设置你的工作,以继续在上游版本中工作。以下命令可能如下: 8 ^! k2 T$ Q0 b" \6 K' s
# Add the remote,call it "upstream":git remote add upstream https://github.com/whoever/whatever.git# Fetch all the branches of that remote into remote-tracking branchesgit fetch upstream# Make sure that you're on your master branch:git checkout master# 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/master1 ~1 j4 V% u3 z8 F3 A& f