In the project I'm working on right now I have just submitted a merge request that has been merged into master on origin (our gitlab server). After that I made a single commit to fix a typo, and manually merged my branch into master locally (please don't kill me).
I'm now puzzled by the message I get when I run git status
:
On branch master
Your branch is ahead of 'origin/master' by 15 commits.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
Because as far as I understand my local master branch is only 3 commits ahead. This is the (slightly modified) output of git log -n5
:
commit cdbbbfdaf55deef575914f2cbf8cfec549479973 (HEAD -> master)
Merge: bc1a6b9 a32002a
Author: Developer 1 (me)
Date: Wed Jan 4 11:03:45 2023 +0100
Merge into master
commit a32002a75a559943968d8694287dc16b1297e1cf (development-branch)
Author: Developer 1 (me)
Date: Wed Jan 4 11:02:36 2023 +0100
Fixed typo
commit bc1a6b9ba9b56063044730fb20cc5f1b43194dea (origin/master, origin/HEAD)
Merge: 91f3302 eabfd24
Author: Developer 2
Date: Wed Jan 4 09:33:41 2023 +0000
Merge branch 'development-branch' into 'master'
Development branch
See merge request Repository!7
commit eabfd244f4791b66cf4c26a9fb574c9317279021
Author: Developer 1 (me)
Date: Wed Jan 4 09:33:41 2023 +0000
Development branch
commit 9eb2390feec6650a446bff4e9309bd29c7ed18e8 (origin/development-branch)
Merge: 2517a68 91f3302
Author: Developer 1 (me)
Date: Wed Jan 4 10:26:37 2023 +0100
Merge
A git pull
says everything is up to date. Why this discrepancy?
Edit
As @florieger points out, the output of git log origin/master..master
shows 15 commits, the first three of which are:
commit cdbbbfdaf55deef575914f2cbf8cfec549479973 (HEAD -> master)
Merge: bc1a6b9 a32002a
Author: Developer 1 (me)
Date: Wed Jan 4 11:03:45 2023 +0100
Merge into master
commit a32002a75a559943968d8694287dc16b1297e1cf (development-branch)
Author: Developer 1 (me)
Date: Wed Jan 4 11:02:36 2023 +0100
Fixed typo
commit 9eb2390feec6650a446bff4e9309bd29c7ed18e8 (origin/development-branch)
Merge: 2517a68 91f3302
Author: Developer 1 (me)
Date: Wed Jan 4 10:26:37 2023 +0100
Merge
(12 additional commits not shown)
i.e. commits 1, 2 and 5 in git log -n5
. But why is the merge (bc1a6) not visible here? The output of git log -n5
seems to me to suggest that origin/master points to this ref, so why are they different?