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

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:// c_b@bitbucket.org ': error: unable to delete 'imagesTest': remote ref does not exist error: failed to push some refs to 'https:// c_b@bitbucket.org /c_b/test.gadget.git' I:\Work\bitbucket\test.gadget [master]> 

How to clear link to imagesTest from my local repository?
(Yes, I could start by cloning the remote repositories again, but I'd rather clear the local copy ...)
Thanks for any info ...

+7
source share
3 answers

The remote branch was probably deleted by another person, but your local repo is not aware of this until you run git fetch --prune .

This command will remove from your local repo branches that no longer exist on the remote computer.

+12
source

Your first command should use the --prune switch

 git remote update -p 

This will remove the deleted remote branches from all updated remotes

+2
source

The safest way is to use

 git remote prune origin 

I prefer to use less hyphens and other punctuation characters. Code and commands should flow like poetry, so that we type faster, write more!

0
source

All Articles