Gibhub承诺还是福克? [英] Gibhub Commit or Fork?

查看:153
本文介绍了Gibhub承诺还是福克?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我是否完全理解何时分叉github项目。我即将为我的项目添加一个大部分,我想知道我是否应该只是提交更改或者这是分叉的好时机吗?



依据在他们的帮助页面中,如果访问者想要编辑项目的代码,则主要使用fork。但是,如果我需要删除新的添加项并返回当前设置,那么在提交和分支之间是否有首选选项?



谢谢,



~Mike

I'm not sure I'm fully understanding when to fork a github project. I am about to add a big segment to my project and am wondering if I'm supposed to just commit the changes or is this a good time to fork?

According to their help pages a fork is used mainly if a visitor wanted to edit the project's code. But if I need to trash the new addition(s) and go back to the current setup is there a preferred option here between a commit and fork?

Thanks,

~Mike

推荐答案

你不需要分叉。我建议在这里使用不同的分支。在此分支上,您可以添加新段,当您认为它已准备就绪时,将该分支与您的主分支合并。我不认为这是一个好主意。如果您在主分支上使用提交并在新段上犯了一些错误,则可能需要撤消一些提交,如果您还在主分支上提交其他更改,则可能很难。如果您使用不同的分支并犯了错误,您只需要在该分支上恢复提交,而不是在主分支上。当细分完成后,将新分支与主分支合并。



有关使用分支和合并的一些信息:

http://git-scm.com/book/en/v2/Git-分支 - 基本 - 分支 - 合并 [ ^ ]
You don't need to fork. I suggest using a different branch here. On this branch, you can add the new segment and when you think it is ready, merge that branch with your master branch. I don't think committing is a good idea here. If you use commits on your master branch and make some mistakes on your new segment, you might need to reverse some commits which might be difficult if you also commit other changes on your master branch. If you use a different branch and make a mistake, you just need to revert a commit on that branch and not on your master branch. And when the segment is finished, merge the new branch with your master branch.

Some information about using branches and merging:
http://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging[^]


这篇关于Gibhub承诺还是福克?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆