git rebase开发分支 [英] git rebase develop branch

查看:152
本文介绍了git rebase开发分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,只是另一个变基"问题,但对此我感到困惑.
在不定时的情况下,我将自己在commit分支上的提交推送到远程(原始).现在,rebase经常提到的一件事是:如果您已推送更改,请不要重新设置基础."
这意味着,我永远都无法重新建立我的开发分支的基础,只能合并它?

Sorry, just another "rebase" question but I'm confused about that.
Form time to time I push my commits on the develop branch to remote (origin). Now one thing always mentioned with rebase is: "never rebase if you have pushed your changes".
This means, I could never ever rebase my develop branch, only merge it?

在功能分支上的工作很明显,如果我还没有推动的话,我可以重新设置基础而不是合并.我的问题只指向开发分支.

Working on a feature-branch is clear, if I haven't pushed that, I could rebase instead of merge. My question only points to the develop branch.

推荐答案

阅读—它提供了很好的图片解释. git-rebase手册页还包含部分从上游基准恢复中恢复"),使您出现在可能受到基准影响的每个人的面前. ;-)还包括精美的ASCII艺术.

Read "The Perils of Rebase" in the "Pro Git" book — it provides nice explanation with pictures. The git-rebase manual page also contains the section "Recovering from upstream rebase") which makes you appear in the shoes of everyone who might be affected by your rebase. ;-) Nice ASCII-art is included as well.

不,永远不要将推送到公共仓库的内容重新设定基础"作为教条:有时,这是一种有效的方法,如果这样的重新编制明确地向您的公共存储库的其他用户清楚地说明了话.例如,请参见当前的Git维护者对其"pu"分支的看法(此备忘录有点过时了,本文的较新版本没有直接提及变基,因此我决定链接到此较旧的副本.

And no, "never rebase what was pushed to a public repo" should not be taken as a dogma: sometimes, it's a valid approach, if such rebasing is clearly articulated to other users of your public repository. For instance, see what the current Git maintainer says about his "pu" branch (this memo is somewhat outdated, and newer versions of this text do not mention rebasing directly, so I decided to link to this older copy).

这篇关于git rebase开发分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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