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?
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.
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.
Whenever you clone a git repository, you get a local copy in your system. So, for your local copy, the actual repository is upstream.
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.
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.
Try the below:
git config --unset branch.<branch>.remote git config --unset branch.<branch>.merge
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With