Question

In source tree, I am 4 behind after resetting to an earlier commit, so the other commits from origin are still present. How can I 'tell' origin that I don't want them?

No correct solution

OTHER TIPS

If the commits are in origin, you will always be behind. Your local repo only knows this because of the "remote tracking branch" referred to as origin/branchname. If you want, you can delete this with git branch -rd origin/branchname. Strictly speaking this is unnecessary since the current location of your branch does not contain the commits from origin.

Assuming you have

commit_id3
commit_id2
commit_id1

with commit_id3 being the latest commit.

It depends on how you have performed the reset operation. If you have done git reset <commit_id1> then the HEAD will be pointing to that particular commit_id1, but all the files that you have committed later(as part of commit_id2 and commit_id3) will appear as modified files when you do a git status. If you do a git reset --hard <commit_id1>, the only difference is the changes done in commit_id2 and commit_id3 are lost. Looks like in your case you need git reset --hard <commit_id1>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top