0

Sometimes when I want to merge branch "foo" which has around 40 files modified to "production", Gitlab doesn't show me even one difference.

=> On local, I did a git fetch and on "production" branch did a git diff foo --name-only that show me all the files. So I got changes on local. => On gitlab I can see all the changes when I'm browsing the repo's files but when I want to do a merge request, all changes disapeared. So changes are well sent to gitlab.

All changes are either commented, deleted or added code.

What's the sorcery behind this? It seems that appears when the branch have too many changes or was old enough from the current branch to merge.

Some person seems to have the same "problem" like this one or this one but it's not exactly what I'm facing.

  • Try these commands locally: `git diff production...foo --name-only`. (Note there are 3 dots there.) Then flip the branches: `git diff foo...production --name-only`. Please share how many files are listed for each. – TTT Mar 12 '23 at 21:46
  • I was able to handle this by hand this time but it's occuring on more time. For the first command I have no changes and for the second I have 13 changes/files differents. When I try to push my changes from local to remote with a simple "git push baz" I have sometimes a "fatal : 'baz' does not appear to be a git repository" which is weird because I already pushed on it and I can even see it with a "git branch -a"... – Jonathan V. Apr 04 '23 at 12:04
  • In the case where the first command is empty, and the second command has output, then that means there are no commits on `foo` that are not already on `production`, or if there are any, they are all empty commits. If the merge request shows commits will be merged without any changes, then those commits are empty (or merge commits). The diff you did with `production` checked out`, was the same as `git diff foo production --name-only` which will show you all changes that happened on `production` after `foo`. Your `foo` is *probably* just old and can *probably* be safely deleted. – TTT Apr 04 '23 at 17:34

0 Answers0