我试图跟踪一个远程分支并最终执行以下操作:
$ git branch --track origin/branch1
Branch origin/branch1 set up to track local branch branch1.
这显然不是我打算做的。我该如何撤消此设置?我自己试着纠正它:
$ git branch --track origin branch1
error: there are still refs under 'refs/heads/origin'
fatal: Failed to lock ref for update: Is a directory
$ git branch --track branch1 origin/branch1
fatal: A branch named 'branch1' already exists.
$ git branch --no-track origin/branch1
fatal: A branch named 'origin/branch1' already exists.
......无济于事。提前谢谢!
答案 0 :(得分:2)
只需删除分支。
git branch -d origin/branch1