Pull request showing commits that have already been merged (via fast-forward merge) #39031
Replies: 23 comments 5 replies
-
As a workaround you can change the base branch for the PR to some other branch and then back to |
Beta Was this translation helpful? Give feedback.
-
Did anyone find a more permanent fix for this? I am experiencing old diffs all the time, it is really a hassle. |
Beta Was this translation helpful? Give feedback.
-
Same here we're experiencing the same issue |
Beta Was this translation helpful? Give feedback.
-
Seeing this lately here as well, but on github.com, not Github Enterprise. |
Beta Was this translation helpful? Give feedback.
-
Im seeing this as well on github.com. Driving me nuts. |
Beta Was this translation helpful? Give feedback.
-
I'm seeing the same behavior on github.com. It's so hard to then tell what changes are 'actually' to be reviewed and merged in the PR. I tried the switch-the-base-branch work around, but to no avail. |
Beta Was this translation helpful? Give feedback.
-
To me, this is a major bug and flaw in GitHub. The whole reason we use PRs is to understand what has changed and review them. We can't trust the most basic functionality of the product. This is ridiculous. |
Beta Was this translation helpful? Give feedback.
-
I ran into this today for the first time and thought I was taking crazy pills:
I was getting ready to pile onto this issue, HOWEVER I noticed one key thing that I usually do that I forgot to do in this case, which I will share in case anyone is dense like me. After merging my last PR, I forgot to pull |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing the same issue as well. Has anyone got a solution for this? |
Beta Was this translation helpful? Give feedback.
-
Normally, in this case I delete my pull request and create it again from the same branch which then shows only my changes. |
Beta Was this translation helpful? Give feedback.
-
I not sure but for me rebasing the feature branch from main branch solves this issues. |
Beta Was this translation helpful? Give feedback.
-
I've found a solution for this. So apparently, I've been squash commits merged in from the target branch, and this creates a new commit and interestingly GH doesn't recognise that this commit is already in. So I have to rebase and force push, and just have to keep in mind not to squash commits before merging. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. When I choose the 'rebase and merge' option the commit hashes change and even though I just merged dev to main, dev is behind again because of the changed commit hashes. This is so annoying and the only solution is to rebase and force push everytime?! There is a discussion on stackoverflow about this issue (https://stackoverflow.com/questions/68878506/github-rebase-merge-creates-new-commit-hashes). There are 3 options to merge.
Why is there no option for a fast-forward merge? Why always rebase even if there are no conflicts? If I need to rebase and force-push all the time why even have PRs at all? Additionally every force push triggers an additional build that I do not need, that is time consuming and takes resources. So I usually cancel the build, but this also means that I have an alleged 'failed' build for the branch. Is there really no way to solve this? |
Beta Was this translation helpful? Give feedback.
-
Hey GitHub, Any timeline for an actual resolution, making this issue go away for good? This is a constant annoyance, for a few reasons:
Please make it better, we really want to love GitHub but this issue is really making it hard for us |
Beta Was this translation helpful? Give feedback.
-
Adding my voice to this. |
Beta Was this translation helpful? Give feedback.
-
Hey GitHub, is there any planned fix for this issue |
Beta Was this translation helpful? Give feedback.
-
Joining in the conversation here - this is an extreme annoyance. It makes a normal, sane branching strategy extremely cumbersome. Diffing branches locally shows zero differences, however the PR I open in GitHub shows craziness. Please fix or we'll consider moving over to GitLab. |
Beta Was this translation helpful? Give feedback.
-
Some time ago I opened a support ticket for this and received a pretty unhelpful answer (see below). At least they seem aware about the issue, but as to plans in changing this ..... I don't know could be a while. I would suggest anyone who is annoyed to also open a ticket, maybe it gets solved faster if more people complain. Message from GitHub- Support Thank you for reaching out with your concerns, and I understand how frustrating this situation can be. When you merge a pull request using either the squash or rebase options on GitHub, it creates new commit(s) in the base branch. However, the original commits still exist in your source branch. This is why your source branch appears "outdated" after such merges because the exact commits don't match between the branches, even though the content might. For branches that you plan to keep using after merging i.e long-running branches, a merge commit might be more suitable despite its tendency to clutter history. This method preserves the exact commit history and can help avoid the branch being flagged as outdated. The behavior you're experiencing with rebase and merge is indeed different from a traditional git rebase command. We mention this here: Rebasing and merging your commits Rebase and merge on GitHub will always update the committer information and create new commit SHAs, whereas git rebase outside of GitHub does not change the committer information when the rebase happens on top of an ancestor commit. We do not have a true fast-forward merge option available on GitHub. An alternative workflow to workaround this limitation could be to create a PR, make sure all checks and other requirements pass on GitHub, perform a fast-forward merge locally via the command line, and then pushing the changes back to the remote branch. This approach keeps your branches in sync without additional force-pushes. We're aware of the community's requests for more flexibility in merge options, including fast-forward merges directly within GitHub. I've forwarded your feedback to our product team for consideration. While our roadmap isn't public, we regularly update the GitHub Blog with new features and updates. We also encourage you to share any further thoughts or details through our feedback form. Our product team monitors these discussions closely to understand user needs better. If you have any more questions or need further clarification, please feel free to reach out. Regards, |
Beta Was this translation helpful? Give feedback.
-
I thought I was all alone and doing something wrong, but then I found this post. This has driven me mad. The "Delete and recreate PR 2 (feature-branch-2) after PR 1 (feature-branch-1) is merged" workaround is the only thing I've found that works to clean up the commits, but it's a pain, especially when you want to get things done quickly. |
Beta Was this translation helpful? Give feedback.
-
I came across this issue today. Many files are showing changes which are already in the main branch. I would not want those files touched unnecessarily. The PR should only show the changes w.r.t. the branch to be merged into (in my case the main branch). As some other user commented earlier, this functionality should be the essence of the product. @github Please support and resolve. |
Beta Was this translation helpful? Give feedback.
-
We have the same issue, PRs show changes that are already on the target branch. I really don't know what Github uses to compare branches in Pull Requests but it's completely wrong. |
Beta Was this translation helpful? Give feedback.
-
Hey Github, are you seeing community messages ? What is the plan to resolve it ? |
Beta Was this translation helpful? Give feedback.
-
I stopped using squash and rebase to avoid this issue. The downside is that I have all the commit messages of a feature also in the main branch. But still better than having these awful merge conflicts especially with SQL statements. I wasn't expecting this issue to be open so long with GitHub actually. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
Using GitHub enterprise, I have the following situation:
master
is at SHAdeadbeef
feature/branch1
is 3x commits ahead ofmaster
(fast-forward mergable intomaster
)feature/branch2
is 2x commits ahead offeature/branch1
(fast-forward mergable into bothmaster
andfeature/branch1
)I open up a couple of PRs:
feature/branch1
intomaster
(PR 1)feature/branch2
intomaster
(PR 2)Initially, PR 2 shows the commits from both
feature/branch1
&feature/branch2
- this is expected (total of 5 commits on the PR). However when I merge PR 1 (by way of fast-forward merge), the commit list in PR 2 continues to show all 5 commits (including the 3 that have already been merged).Expected behvaiour is for PR 2 to update and only show the (2x) commits that have not yet been merged into master yet. Note that if I create a brand new PR (merging
feature/branch2
intomaster
) then it only shows the 2x commits.Beta Was this translation helpful? Give feedback.
All reactions