简体   繁体   English

为什么我的分支合并到源树图中后挂起

[英]Why my branch pending after merged in sourcetree graph

My problem is like this: I have a master branch. 我的问题是这样的:我有一个master分支。 To release a new version, I made some version related changes and commit the changes. 要发布新版本,我进行了一些与版本有关的更改并提交了更改。 I used to push directly, while now I realized that it is not a good idea. 我曾经直接推动,而现在我意识到这不是一个好主意。 So I checkout a new branch sfma_build. 所以我签出了一个新的分支sfma_build。 Then I push this local branch to remote repo, and pull request. 然后,我将此本地分支推送到远程仓库,并拉取请求。 After that, I merged the remote sfma_build into remote master. 之后,我将远程sfma_build合并到远程主服务器中。 Now in sourcetree, the graph looks like this: 现在在sourcetree中,图形如下所示:
在此处输入图片说明

While I think the graph should look like this: 虽然我认为该图应如下所示:
在此处输入图片说明

I mean, origin/sfma_build branch has already been merged to origin/master branch, right? 我的意思是,origin / sfma_build分支已经合并到origin / master分支,对吗? So there should be line segment connecting back to form a cycle? 那么应该有线段重新连接形成一个循环吗? That's what I see when other branches are merged. 这就是我合并其他分支时看到的内容。

We had this same issue until we changed our merge strategy on BitBucket. 在更改BitBucket上的合并策略之前,我们一直遇到同样的问题。 It's hard to tell from your cropped images, but in our case we changed to squash and merge . 从裁切后的图像很难分辨出来,但是在我们的案例中,我们改为squash and merge The merge commit is important because it has multiple parents, one to the branch you initiated the PR from and the other to the last commit in the branch you PR'ed to. 合并提交很重要,因为它有多个父级,一个是您发起PR的分支,另一个是您创建PR的分支中的最后一个提交。 You can use git log --parents to see the difference between a merge commit with multiple parents and what the commit in your screenshot looks like. 您可以使用git log --parents来查看具有多个父项的合并提交与屏幕快照中的提交之间的区别。

Based on this forum answer it looks like Bitbucket just recently added new merge strategies - https://answers.atlassian.com/questions/44341546/manual-squash-merge-detection-in-bitbucket-server-and-closing-pull-requests 基于此论坛回答它看起来像刚刚到位桶最近添加了新的合并策略- https://answers.atlassian.com/questions/44341546/manual-squash-merge-detection-in-bitbucket-server-and-closing-pull-要求

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

相关问题 Sourcetree:找出是否合并了分支 - Sourcetree: Find out if a branch is merged git说明一个分支在重新定位后没有合并 - 为什么? - git is stating a branch is not merged after rebasing - why? 为什么 GitLab 合并分支的 git log 图被反转了? - Why git log graph of merged branch from GitLab was inverted? SourceTree:为什么分支没有显示为合并? - SourceTree: Why aren't branches showing as merged? Sourcetree 图只显示主分支 - Sourcetree graph only show master branch 在GIT上创建分支后,为什么我的Git图也不能创建分支? - After Create branch on GIT, why my Git Graph not Create a Branch too? 为什么分支报告尽管合并但仍未合并 - Why branch reported as not merged despite on it is merged 为什么我的同事在执行 git 拉取时得到我尚未合并到主分支中的功能分支? - Why is my colleague getting my feature branch that is not merged yet in the main branch while doing a git pull? 为什么sourcetree自动覆盖分支名称? - Why does sourcetree automatically overwrites branch name? 使用 Git,在我的代码提交合并到 master 分支后,我是否要删除我的远程分支,再次克隆 master 并检查下一个分支? - With Git, after my code commits are merged to the master branch, do I delete my remote branch, clone master again and checkout the next branch?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM