git branch 对面的 --set-upstream

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12913988/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:39:00  来源:igfitidea点击:

Opposite of git branch --set-upstream

gitbranch

提问by lucacerone

I would like to stop tracking certain branches. I set up tracking using git branch --set-upstream foo origin/foo.

我想停止跟踪某些分支。我使用git branch --set-upstream foo origin/foo.

How do I undo this?

如何撤消此操作?

采纳答案by manojlds

Try the below:

试试下面的:

git config --unset branch.<branch>.remote
git config --unset branch.<branch>.merge

回答by Mark Longair

In git 1.8, which will be released shortly, you'll be able to do:

在即将发布的 git 1.8 中,您将能够执行以下操作:

git branch --unset-upstream

However, for the moment you would have to do as manojlds suggests, and use two git config --unsetcommands.

但是,目前您必须按照 manojlds 的建议进行操作,并使用两个git config --unset命令。

回答by sataniccrow

If I've understood you want to remove the association between the local and remote branch... I think one of the easiest way should be by editing the config file (.git/config).

如果我明白你想删除本地和远程分支之间的关联......我认为最简单的方法之一应该是编辑配置文件 (.git/config)。

You can find something related to your question here

您可以在此处找到与您的问题相关的内容

To remove the association between the local and remote branch, and delete the local branch, run:

git config --unset branch.<branch>.remote
git config --unset branch.<branch>.merge
git branch -d <branch>

要删除本地和远程分支之间的关联,并删除本地分支,请运行:

git config --unset branch.<branch>.remote
git config --unset branch.<branch>.merge
git branch -d <branch>