41

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

How do I undo this?

Mark Longair
  • 446,582
  • 72
  • 411
  • 327
lucacerone
  • 9,859
  • 13
  • 52
  • 80

3 Answers3

50

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

git branch --unset-upstream

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

Community
  • 1
  • 1
Mark Longair
  • 446,582
  • 72
  • 411
  • 327
27

Try the below:

git config --unset branch.<branch>.remote
git config --unset branch.<branch>.merge
manojlds
  • 290,304
  • 63
  • 469
  • 417
2

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

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>
Community
  • 1
  • 1
sataniccrow
  • 372
  • 2
  • 7