Scenario:
- I make a new branch
- hack on it
- commit it
- push it
- hack on it some more
- commit again
- try to push again
Git responds:
Updates were rejected because the tip of your current branch is behind
its remote counterpart. etc.
I'm the only one hacking on this branch - no one else is touching it. The remote branch is actually behind the local branch. I shouldn't have to pull at all.
(And if I do pull, Git reports conflicts between the two, and forces me to merge the branch into itself)
Why is this (likely) happening? And how can I diagnose/fix it?
To be clear, I'm not branching anywhere, and no one else is working on it:
Remote: Commit A -------- Commit B
Local: Commit A -------- Commit B -------- Commit C
C is a straight continuation of B, no branching involved. But git thinks C is a branch of A:
Remote: Commit A -------- Commit B
------- Commit C
/
Local: Commit A -------- Commit B
It's not; it's a straight continuation of B.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…