github – Useful Mix http://usefulmix.com Something useful every once in a while... Thu, 11 Oct 2018 07:47:17 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.10 Git – How to delete a local branch or remote http://usefulmix.com/git-how-to-delete-a-local-branch-or-remote/ http://usefulmix.com/git-how-to-delete-a-local-branch-or-remote/#respond Thu, 13 Mar 2014 14:37:42 +0000 http://usefulmix.com/?p=266 Continue reading "Git – How to delete a local branch or remote"]]> Git – delete a local branch:

git branch -d some_example_local_branch

Git – delete/remove a remote branch:

git push origin : some_example_remote_branch

In case of error after trying to remove remote branch, run:

git fetch -p

This is what the error message would look like:

error: unable to push to unqualified destination: some_example_remote_branch
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@repository_name'

and this is caused due to the fact that perhaps anyone else has already deleted the branch and you need to synchronize your branch list.

]]>
http://usefulmix.com/git-how-to-delete-a-local-branch-or-remote/feed/ 0