GIT:我如何删除任何使远程分支跟踪本地分支的配置? [英] GIT: How do I remove any configs that makes a remote branch track a local branch?

查看:160
本文介绍了GIT:我如何删除任何使远程分支跟踪本地分支的配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题说的是什么。版本的git是1.5.6.3
我尝试过使用git分支--track
但它会引发错误,说明分支已经存在。我很困惑。



预先感谢!

解决方案

有一个名为例如develop的分支,并且您想要将其从远程的类似命名的分支上解除链接,请尝试以下操作:

  git config --remove-section branch.develop 

这会从您的本地工作副本。



在此变更前后查看 git config --list 以查看差异。你很明显可以通过编辑你的 .git / config 文件来完成同样的事情,但我喜欢使用 git config 相反。


What the title says. Version of git is 1.5.6.3 I've tried using git branch --track But it throws errors saying that the branches already exist. I am confused.

Thanks in advance!

解决方案

If you have a branch named, e.g., "develop" and you want to "unlink" it from a similarly named branch on a remote, try this:

git config --remove-section branch.develop

This will remove the configuration from your local working copy.

Take a look at git config --list before and after this change to see the difference. You could obviously accomplish the same thing by simply editing your .git/config file, but I like to use git config instead.

这篇关于GIT:我如何删除任何使远程分支跟踪本地分支的配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆