0

All,

I am a bit lost with Git operation.

I added 3 commits (4bb, c2e, b8f) to my branch 7.0.0.6 when realized I wanted to include them in a new branch. So I created 7.0.0.7 containing these three commits. After this, hard reset branch 7.0.0.6 prior to the commits. Now the local branches looks like I want them: enter image description here

What I can't figure out how to synchronize the remote origin/7.0.0.6 to local head/7.0.0.6 (that is, omitting the last three commits) ?

Can someone please help with this ?

  • This *looks* like a simple case of requiring `git push -f`, but I'm hesitant to suggest that since you've posted an image (not text) of something that doesn't include the graph (if it included the graph it might have to be an image, though `git log --all --graph --decorate --oneline` provides a graph that's just text). – torek Mar 03 '19 at 20:25
  • git push -f did it, thanks ! –  Mar 04 '19 at 11:28

1 Answers1

0

Ideally,

git reset --hard origin/7.0.0.6

should work for you.

Since from your question it's clear that you have already used git reset --hard to reset your 7.0.0.6 branch, you may need to start by using git reset --hard ORIG_HEAD to move your branch back to where it was before.

Please also check that ORIG_HEAD points to the right commit, with git show ORIG_HEAD.

Vivek
  • 895
  • 11
  • 23