有人可以向我解释一下使用 Git 时“Fork & Pull”工作流程和“Forking”工作流程之间的区别吗?在我看来,这两者都涉及创建您自己的存储库,然后使用 pull 请求请求中央存储库获取您的更改?我已经多次阅读这两者的描述,但我并不清楚它们最终有何不同。
最佳答案
来自“Atlassian: Forking Workflow”
The Forking Workflow is fundamentally different than other popular Git workflows.
如果实际上是pull request模型(由GitHub发起and their fork):每个开发者push到自己的fork repo,并从fork repo向main repo发起pull request,maintainer可以在其中挑选什么整合。
这与经典的 Git 工作流程不同,在经典的 Git 工作流程中,所有开发人员都将推送到相同远程仓库,但在不同的分支中,并使用不同的 merge 工作流程(如 gitworkflow ).
所以:
is the described workflow the same as what others call "Fork and Pull"?
不:这是 GitHub 模型的另一个名称,您在其中 fork 一个存储库,从该 fork 中 pull ,创建一个您推回(到您的 fork )的新分支,并发出 pull 请求。
GitHub contrasts that使用共享存储库模型,协作者被授予对单个共享存储库的推送访问权限,并在需要进行更改时创建主题分支。
Pull requests are useful in this model as they initiate code review and general discussion about a set of changes before the changes are merged into the main development branch.
关于git - "Fork & Pull"工作流与 Git 的 "Forking"工作流相比,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55249168/