您应该在Github上分支还是分支? [英] Should you fork or branch on Github?

查看:126
本文介绍了您应该在Github上分支还是分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

许多github仓库都要求在每个必要的代码更改上创建一个fork.

Many github repos demand creating a fork on every essential code change.

与git中的分支完全一样.

Which is exactly like branching in git.

为什么github引入了forks?

Why did github introduce forks?

推荐答案

(我喜欢git早午餐的想法-git用户在周日开会吃很多油炸食品;))

在github上创建项目并在您自己的存储库中进行更改的想法是,项目所有者不需要信任您或向您推送访问其存储库的权限.如果希望他们考虑合并存储库中的代码,则可以向他们发送 pull请求. GitHub有一个不错的请求请求系统,上游开发人员可以在其中审查和评论您的贡献.

The idea of forking a project on github and making changes in your own repository is that the owners of the project don't need to trust you or give you push access to their repository. If you want them to consider merging code from your repository then you can send them a pull request. GitHub has a nice system of pull requests where the upstream developers can review and comment on your contribution.

在一群值得信赖的开发人员中,每个人都可以推送到一个共享存储库,通常您确实会将您开发的每个新功能都推送到一个新的主题分支中,并请其他人查看您的工作并考虑将其合并.

In a group of trusted developers, where everyone can push to one shared repository, you typically do push each new feature you develop as a new topic branch, and ask other people to review your work and consider it for merging.

关于git的许多好处之一是,与特定分支提示位于哪个存储库无关紧要-提交将始终具有相同的SHA1sum,因此您可以随意将其推拉.是放在GitHub上的fork中还是推送到共享存储库中还是什么都没关系.

One of the many nice things about git is that it doesn't particularly matter which repository a particular branch tip is in - that commit will always have the same SHA1sum, so you can push and pull it around as you like. It doesn't matter really if it's in a fork on GitHub or pushed to a shared repository or whatever...

这篇关于您应该在Github上分支还是分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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