gpt4 book ai didi

git - 撤消 Git 跟踪命令

转载 作者:太空狗 更新时间:2023-10-29 14:15:28 26 4
gpt4 key购买 nike

我试图跟踪一个远程分支并最终执行了以下操作:

$ 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.

...无济于事。提前致谢!

最佳答案

只需删除分支即可。

git branch -d origin/branch1

关于git - 撤消 Git 跟踪命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11787482/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com