'Github pull request shows wrong diff
I am having two branches: - master and - develop.
I am trying to merge branch develop into master branch.
I have checked with Tower and Araxis merge, those two branches are identical. But when I do a pull request on Github, I am seeing that there are 381 files changed, like files are not on master at all.
Any ideas why this behavior?
Update: I am attaching screenshot of pull request.
Solution 1:[1]
It seems like a serious bug to me. Apparently github does not think it is a bug though: https://github.community/t5/How-to-use-Git-and-GitHub/GitHub-pull-requests-showing-invalid-diff-for-already-merged/td-p/3000
Solution 2:[2]
Despite the misleading/broken github interface there's actually a way to get what you want. You need to drop one .
Instead of:
do
This compares branch heads instead of simply using the base branch to find the merge base.
github's reponse is what clued me in from @edwin-evans' response:
This is a result of the type of diff we use on GitHub. We use git’s three dot diff, which is the difference between the latest commit on the HEAD branch and the last common ancestor commit with the base branch.
Solution 3:[3]
There's no reason for which the branch comparison would be different between GitHub and your local.
If you made your branch comparison on your local repo and they were identical, a diff in the pull request must mean that either branch (maybe both?) is not up-to-date with its remote counterpart.
First do a git fetch to update your remote-tracking branches, then checkout each branch and make sure both are up-to-date, either by pushing or pulling, depending on your workflow.
Edit (Summary version of comments below)
When you'll have checked with
git branch -a -vv
and
git log --all --decorate --simplify-by-decoration --oneline
the relative situation of all your branches, you should have different commits for origin/master and origin/develop, since GitHub shows that your master is behind 208 commits.
...which showed the following results :
develop and origin/develop are at commit 5db9361.master and origin/master are at commit d5cc1b1.
Could the GitHub pull request preview be failing? (edit : it's not)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Edwin Evans |
| Solution 2 | Catskul |
| Solution 3 |

