Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reset a git remote tracking branch?

Tags:

git

In another question it was recommend that I try resetting a remote tracking branch to an earlier commit and performing an import a second time. I can't figure out how to do that! I can reset master, but not the branch master is tracking, cvs/master.

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

How do I change the commit to which cvs/master (or any arbitrary remote tracking branch) refers?

like image 918
skiphoppy Avatar asked Sep 10 '25 17:09

skiphoppy


2 Answers

git-cvsimport remote branches are kind of faked out so I think you can just edit the appropriate file in your .git directory (.git/refs/remotes/cvs/master in this case) and put the appropriate commit I'd in the file. I'm not sure if this will fix the problem in your other question though...

like image 76
Brian Phillips Avatar answered Sep 13 '25 13:09

Brian Phillips


Did you try this: create a local branch that targets that remote branch, reset or rebase this local branch to your needs, push the local branch with -f option (force)?

like image 21
Ariya Hidayat Avatar answered Sep 13 '25 13:09

Ariya Hidayat