Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opposite of git branch --set-upstream

Tags:

git

branch

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?

like image 314
lucacerone Avatar asked Oct 16 '12 11:10

lucacerone


People also ask

What is git branch -- set upstream to?

Git set-upstream. The git set-upstream allows you to set the default remote branch for your current local branch. By default, every pull command sets the master as your default remote branch.

What is upstream and downstream git?

Generally speaking, upstream is where you cloned from (the origin). Downstream is any project that integrates your work with other works. The terms are not restricted to Git repositories.

Does git clone set upstream?

Whenever you clone a git repository, you get a local copy in your system. So, for your local copy, the actual repository is upstream.

How do I set up Forstream without pushing?

Set Upstream If you don't want to push anything, you can also do it using git-branch command. A local branch can track a remote branch using git-branch with long option --set-upstream-to=<upstream> or short option -u <upstream> . The command sets up branchname 's tracking information.


2 Answers

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.

like image 188
Mark Longair Avatar answered Nov 09 '22 20:11

Mark Longair


Try the below:

git config --unset branch.<branch>.remote git config --unset branch.<branch>.merge 
like image 40
manojlds Avatar answered Nov 09 '22 20:11

manojlds