我分叉了一个项目,应用了几个修复程序,并创建了一个可接受的提取请求。几天后,另一个贡献者做了另一个改变。所以我的叉子不包括这个变化。 4 x) r; ?3 U7 W+ U我怎样才能把零钱放在叉子里?当我有进一步的改变来做出贡献时,是否需要删除和重建我的分叉?还是有更新按钮? ) m% K8 d& Z; Y7 P, I- _( d* q + ]# p. S7 j4 C) n k9 ~ 解决方案: ) l3 }; X" ` M7 r2 Q4 l
在分叉存储库的本地克隆中,您可以使用原始 GitHub 存储库被添加到远程中。(远程就像存储 URL 的昵称 -origin例如,它是一个。)然后你可以从上游存储库中获得所有的分支,并重新设置你的工作,以继续在上游版本中工作。以下命令可能如下: 3 q, H' k+ d1 T3 g& ]% q, ^
# 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/master$ \) b1 r# n+ R