Disconnect local branch from remote one
Asked Answered
L

1

5

I have two local branches A and B tracking the same remote branch C. I want to keep all the branches but I want to remove connection A -> C but keep the connection B -> C. how can i do that?

Laguna answered 7/4, 2014 at 8:35 Comment(0)
F
7

Remove the asaociaton between the local and remote branch

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

Alternatively in your project's .git/config file remove the merge statement corresponding to the branch A.


Alternatively you can create a new branch D from A, and then delete the original branch A if needed.

git checkout A
git checkout -b D

#Delete A if needed
git branch -D A
Ferrotype answered 7/4, 2014 at 8:40 Comment(1)
As of git 1.8, you have another variant to remove the association: git branch --unset-upstream AChatterjee

© 2022 - 2024 — McMap. All rights reserved.