0

I deleted my branch named branchName by using git branch -d branchName.

After that I wanted to delete its remote tracking branch too. So I did like this git branch -d remotes/origin/branchName but I am getting error: branch 'remotes/origin/branchName not found. Why?

When I do git branch -a , I can see the reference remotes/origin/branchName exists.

I know that if we do git push origin :branchName , remote tracking branch will be removed by that but why not by git branch -d after all it is just a reference ? Also what is the meaning of the error message ?

Number945
  • 4,631
  • 8
  • 45
  • 83
  • 2
    A classic. See [How do I delete a Git branch both locally and remotely?](https://stackoverflow.com/questions/2003505/how-do-i-delete-a-git-branch-both-locally-and-remotely). – Romain Valeri Sep 17 '18 at 14:24
  • in [git branch docs](https://git-scm.com/docs/git-branch#_description) , `Use -r together with -d to delete remote-tracking branches.` – Number945 Sep 17 '18 at 14:36

0 Answers0