How to reset a git remote tracking branch?

In another question, it was recommended to try resetting the remote tracking branch to an earlier commit and import for the second time. I can’t figure out how to do this! I can reset master, but does not track the branch master, cvs / master.

If I check cvs / master, I'm not on a branch, so git - reset has no effect.

How to change the commit referenced by cvs / master (or any arbitrary remote tracking branch)?

+3
source share
2 answers

git -cvsimport the remote branches seem to be tampered with, so I think you can just edit the corresponding file in your .git directory (.git / refs / remotes / cvs / master in this case) and put the appropriate commit I would in the file. I am not sure if this will fix the issue in your other question though ...

+3
source

Have you tried this: create a local branch dedicated to this remote branch, reset or reconnect this local branch to your needs, click the local branch with the -f (force) option?

+3
source

Source: https://habr.com/ru/post/1705690/


All Articles