简体   繁体   English

发布分支合并后,为什么母版1提前开发?

[英]After merge of release branch, why is master 1 commit ahead of develop?

I am still new to this so I am trying to understand why master ends up 1 commit ahead of develop instead of the same after merging a release branch back into develop and master . 我对此还很陌生,所以我试图理解为什么masterdevelop之前将1提交最终提交到develop而不是在将release分支合并回developmaster之后提交相同的提交。

My develop branch was 5 commits ahead of master, then I created a release branch and tagged which was also 5 commits ahead of master , then I merged release branch back into develop and master but master ends up 1 commit ahead of develop . 我的develop分支比master提前5次提交,然后我创建了一个release分支并进行了标记,这也是master之前的5次提交,然后我将release分支合并回developmaster但是masterdevelop之前先完成了1次提交。

Is this because no changes were made to the release branch and it was the same as develop so the merge didn't create a commit on develop but it did on master which makes master 1 commit ahead even though master and develop now are the same at this point? 这是因为没有变化的制作release分支,它是一样的develop因此合并没有创建提交上develop ,但它做了master ,这使得master 1犯提前即使masterdevelop正处在同一这点?

Is this ok? 这个可以吗? Will this cause any problems? 这会引起任何问题吗?

The issue is that the merge commit is being detected. 问题是正在检测到合并提交。 Your commit history probably looks something like this: 您的提交历史可能看起来像这样:

*------------------ A [master]
 \                 /
  *---*---*---*---B [develop,release]

Commit B is, as you mention, 5 commits ahead of master . 正如您所提到的,提交Bmaster提交5次。 When you merged the release branch back into master , this created a merge commit, A . 当您将发布分支合并回master ,这将创建一个合并提交A That merge commit does not yet exist in develop . 这合并提交不存在尚未develop

This is not something that you need to worry about, because the merge commit doesn't contain any changes itself, it only merges the two histories together. 这不是您需要担心的事情,因为合并提交本身并不包含任何更改,它只会将两个历史记录合并在一起。 Normally, that commit will automatically end up in develop next time you finish a hotfix branch anyway. 通常,下次您仍然要完成hotfix分支时,该提交将自动在develop结束。

IMO that 1 commit ahead is compared to origin/master or the remote branch your master is tracking. 将1个提交前面的IMO与源/主服务器或您的主服务器正在跟踪的远程分支进行比较。 Since you have do a merge on local branch, it will create a new commit for that merge on your local master, therefore makes it 1 commit ahead. 由于您已经在本地分支上进行了合并,因此它将在本地主服务器上为该合并创建一个新的提交,因此使其提前1次提交。

现在,您必须快速发展为大师才能在同一水平上拥有大师和发展

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “您的分支比“源/主”要早1次提交。” 合并后 - 'Your branch is ahead of 'origin/master' by 1 commit.' after merge 为什么合并后本地 master 分支比远程 master 领先一个? - Why is the local master branch one ahead of remote master after merge? 将发布分支合并到 master 后,release 仍然显示为在 master 之前提交了这么多提交 - After merge of release branch to master, release still shows as being so many commits ahead of master 发布后 Gitflow 在 master 后面开发分支 - Gitflow develop branch behind master after a release 使用“git flow release finish”为什么将master合并到develop不使用release分支? - Using "git flow release finish" why merge master into develop not use the release branch? 推送分支后“您的分支比 'origin/master' 领先 1 个提交” - “Your branch is ahead of 'origin/master' by 1 commit” after pushing branch 在“成功的git分支模型”中将Develop的提交合并到Master分支 - Merge a commit from Develop to Master branch in the “successful git branching model” VSTS GIT将开发分支合并到母版,而没有母版认为这是1个变更集? - VSTS GIT merge develop branch into master without master thinking it is 1 change-set ahead? 合并后分支在原点之前超过一次提交 - Branch is ahead of origin by more than one commit after merge Git-Flow,为什么“开发”分支在“发布完成”之后比“母版”高出一步 - Git-Flow, Why is “develop” branch one step beyond “master” after “release finish”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM