[英]Workflow for Updating/Maintaining a forked git repository
I have forked a repo for adding some changes to the project; 我已经为该项目添加了一些更改而创建了一个仓库。 its a Vim plugin.
它是一个Vim插件。 I am planning to use my forked repo as the source for Vundle.
我打算将叉式存储库用作Vundle的源。 But I would also like to get updates from the original repo if any in the future.
但是我也希望将来从原始存储库中获取更新。
How should I go about maintaining the repo? 我应该如何维护回购协议?
note: 注意:
If you're improving the plugin, the best solution might be to propose your patch to the owner of the original repo. 如果您要改进插件,最好的解决方案可能是向原始存储库的所有者提出补丁。
If you can't or don't want to do it, you could either keep it in a dev branch or in your master
. 如果您不能或不想这样做,则可以将其保留在dev分支或
master
。 It won't make any difference: either way you'll have to do a merge between your branch and origin/master
every time you'll want to retrieve update from upstream. 不会有任何区别:无论哪种方式,每次您要从上游检索更新时,都必须在分支机构与
origin/master
之间进行合并。
Example: let's assume you want to keep it on your local master
branch. 示例:假设您要将其保留在本地
master
分支上。 Then you would have: 然后您将拥有:
A ----------------- B
L origin/master L master
where B
is the commit you made with your modifications. 其中
B
是您所做的修改。
When you want to retrieve updates from upstream, using git fetch origin
, you would end up with: 当您想使用
git fetch origin
从上游检索更新时,您将得到以下结果:
---- B
/ L master
/
A -- C -- D
L origin/master
Then you'd just need to do, from your master
branch: git merge origin/master
, in order to get a commit with both your modifications and the updates 然后,您只需要在
master
分支中做: git merge origin/master
,以便同时进行修改和更新
---- B -- E
/ /L master
/ /
A -- C -- D
L origin/master
As we can see, it would be easier if your changes could be accepted upstream. 如我们所见,如果您的更改可以在上游被接受,将会更加容易。 Not only could anyone benefit from it;
不仅任何人都可以从中受益。 it would also be much easier for you.
对您来说也将容易得多。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.