0 votes
1 view
in Devops and Agile by (20k points)

How do you stop tracking a remote branch in Git?

I am asking to stop tracking because in my concrete case, I want to delete the local branch, but not the remote one. Deleting the local one and pushing the deletion to remote will delete the remote branch as well:

How do I delete a Git branch both locally and in GitHub?

Can I just do git branch -d the_branch, and it won't get propagated when I later git push?

Will it only propagate if I were to run git push origin :the_branch later on?

1 Answer

0 votes
by (28.4k points)

In order to remove the upstream for the current branch do:

$ git branch --unset-upstream

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !