在发出拉取请求之前,我是否应该使用dev分支重新设置基础? [英] Should I rebase with dev branch before making a pull request?
问题描述
我们当前的工作流程:
从dev创建功能分支.开发功能并推动分支之后请执行以下操作:
create a feature branch from dev. after developing the feature and having pushed the branch do a the following:
git checkout开发人员
git pull --rebase
(在dev上)
git checkout my-feature-branch
git rebase dev
解决冲突,然后执行git push -f或git push(第一次).
resolve conflicts and then do a git push -f or git push (first time).
我的问题来自我们的开发团队成员之一:
My question comes from one of our development team members:
我们是否需要按原样进行整个过程,还是可以直接进行拉取请求,特别是响应始终是我正在使用一个其他开发人员都不共享的组件"?
预先感谢
推荐答案
比方说,当您在 feature-branch
上工作时,新内容将集成到 dev
分支.因此历史记录可能如下所示:
Let's say, while you are working on your feature-branch
, new stuff is integrated onto the dev
branch. So the history might look like this:
1 - 2 - 3 - 5 (dev)
\
4 - 6 - 7 - 8 (feature-branch)
如果仅创建请求请求,而 dev
分支维护者将不得不合并它,则他将需要处理潜在的冲突-对 dev
不利分支维护者.
If you simply create a pull-request and the dev
branch maintainer would have to merge it, he would need to deal with potential conflicts -- bad for the dev
branch maintainer.
如果将 feature-branch
分支基于 dev
并在提交请求之前解决潜在的冲突,
If you rebase the feature-branch
branch onto dev
and resolve potential conflicts before submitting the pull-request,
1 - 2 - 3 - 5 (dev)
\
4 - 6 - 7 - 8 (feature-branch)
对于 dev
分支维护者而言,这只是一种快速,轻松的快进合并.
it will be just a quick and easy fast-forward merge for the dev
branch maintainer.
此工作流程强制开发人员在本地解决冲突,并使集成商的工作更加轻松.
This workflow enforces developers to resolve conflicts locally and makes the live of the integrator easier.
这篇关于在发出拉取请求之前,我是否应该使用dev分支重新设置基础?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!