Yesterday we had this very strange situation with git:
We created a feature branch as we always do. Then, somebody would work for some days on that feature branch.
In the meantime, something important happened on the master branch. These changes were needed by the feature branch, too.
Therefore, we merged the master branch into the feature branch (no rebase because our feature branches are usually immediately pushed to remote as we need to collaborate on a feature). This merge was only done locally and not yet pushed to remote.
Work on the feature branch continued
With the merge from master + the continued work the local feature branch new_feature was now ahead of origin/new_feature by 40 commits
Now we wanted to push these 40 commits to the remote feature branch. First we do a git pull --rebase as we always do before we push because somebody else might have pushed some commits before us.
Now we experience tons and tons of conflicts. We decide it's not worth fixing 40 commits and do a git rebase --abort. Then we try a git pull --no-rebase. We get: "Already up-to-date" - Strange
Since git status does not tell us that our local branch and the remote branch have diverged, we try git push
Unexpectedly, git push worked. We would get a rejected if we tried to push to a remote branch that has changed since we last pulled. So obviously remote hasn't changed but git pull --rebase did something strange.
So what's strange about this is that
git pull --rebase did not immediately return "Already up-to-date" and
git pull --rebase reported a ton of conflicts where really none should exit (the reported conflicts had nothing to do with the stuff that was worked on on the feature branch)
What could cause such a situation?