Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trying to delete remote branch; listed locally, repos says it doesn't exist

Tags:

git

Here is what I have tried so far:

I:\Work\bitbucket\test.gadget [master]> git remote update
Fetching origin
I:\Work\bitbucket\test.gadget [master]> git branch -r
  origin/HEAD -> origin/master
  origin/imagesTest
  origin/master
  origin/work2
I:\Work\bitbucket\test.gadget [master]> git push origin :imagesTest
Password for 'https://[email protected]':
error: unable to delete 'imagesTest': remote ref does not exist
error: failed to push some refs to 'https://[email protected]/c_b/test.gadget.git'
I:\Work\bitbucket\test.gadget [master]>  

How do I purge the reference to imagesTest from my local repository?
(Yes, I could start by cloning the remote repos. again, but I'd rather clean up the local copy...)
Thanks for any insights...

like image 334
Number8 Avatar asked Jun 11 '13 14:06

Number8


1 Answers

Remote branch was probably deleted by another person, but your local repo isn't aware of this until you run a git fetch --prune.

This command will delete from your local repo branches that doesn't exists anymore on remote.

like image 171
Guillaume Darmont Avatar answered Sep 18 '22 17:09

Guillaume Darmont