1

I have been using github for my latest project but something weird happened. We messed up so we had to roll back. To do this I used the check out command on the commit we wanted to roll back to. Then I pushed that upstream. But now my branch no longer says main and I can't figure out what to do. My history is in the following link: History

We rolled back to "Fixed, makes sense passing around Joe". Now when I push it brings up a weird dialogue box that says "push branch in remote". So, I was wondering if there was a command to make what I have on my computer the regular old Master branch.

EDIT: One more thing, the basic pull (with out a ...) and the PUSH to upstream options are now grayed out in the team tab of eclipse.

  • 1
    Checking out a commit will put you into a detached state. What do you see when you run command `git status` on the command line? – Todd May 22 '18 at 01:46
  • 1
    If Eclipse prints what commands it executed when you `pushed` the checked out branch, share that here (Try the console tab). That will help us understand what happened. To add to what @Todd said, when you checkout a single commit you are sort of in a no man's land. It is always better to checkout to a commit with a branch. That way you have a pointer to that point in history. – brahmana May 22 '18 at 02:48

1 Answers1

0

Check in command line if a git status shows you a detached HEAD situation.

You would need, with eclipse, to hard reset your master branch to the commit you want, in order to make sure it is not in that state.
But make sure your colleagues are aware of that because you might need to force push that (reset) branch and anyone working on that repo would need to reset his/her own branch to the new history.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250