0

Here's the sequence

I have no edits on the branch at this point

  1. I did a git pull --rebase in a branch that is tracked to a remote branch
  2. Conflicts occured
  3. I did git reset --hard
  4. then git rebase --abort

And now it says that my branch is ahead by X commits

I tried doing git reset --hard again then git fetch then git fetch origin then git checkout the branch again all to no avail

how do I solve this problem?

pillarOfLight
  • 8,592
  • 15
  • 60
  • 90
  • 1
    Impossible to answer as we don't know to what commits did you reset your branch and some other important things. – wRAR Mar 22 '13 at 23:26
  • Try git diff origin/master to see which commits are ahead – Jure C. Mar 22 '13 at 23:27
  • It's `log`, not `diff` – wRAR Mar 22 '13 at 23:29
  • 1
    `git reflog` may help you finding your `HEAD` – dyng Mar 22 '13 at 23:59
  • @pillarOfLight: "branch is ahead by X commits" simply means that you have X commits which arent pushed to the tracked branch yet. If you undid the pull and havent pushed since, that's only logical. You'll have to pull and/or merge into the upstream changes and push it to the tracked branch for that message to go away – Nevik Rehnel Mar 23 '13 at 10:19

1 Answers1

0

The fact that you are X commits ahead is a consequence of the implied git fetch that was done during your initial git pull (you also did an explicit git fetch afterwards). It just means that these commits aren't pushed to the tracked branch yet. That's not a problem at all. This message will disappear once those commits are pushed.

Simon
  • 31,675
  • 9
  • 80
  • 92