문제

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?

올바른 솔루션이 없습니다

다른 팁

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>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top