version control - Remove remote branches in Git -


this question has answer here:

i want delete remote branches of project repository. i've run next command:

git push origin :name_of_branch 

and when list remote branches with

git branch -r 

the branch i've deleted doesn't appear, partner of mine run

git fetch 

and later

git branch -r 

and in list, branch name_of_branch had deleted, still in list. however, when tries delete branch with

git push origin :name_of_branch 

he receives next message:

error: unable delete 'name_of_branch': remote ref not exist error: failed push refs 'the_name_of_the_repository' 

how delete branch of list?

this happens because when partner of yours runs git fetch, branch deletion not "applied" repository. fetch updates , adds branches.

they can run git remote prune origin trim away remote branches in list no longer exist in upstream repository.


Comments