Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (19.4k 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 (27.5k points)

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

$ git branch --unset-upstream

Related questions

Browse Categories