Delete remote branch in git => http://stephdisdoctresp.nnmcloud.ru/d?s=YToyOntzOjc6InJlZmVyZXIiO3M6MjE6Imh0dHA6Ly9iaXRiaW4uaXQyX2RsLyI7czozOiJrZXkiO3M6Mjc6IkRlbGV0ZSByZW1vdGUgYnJhbmNoIGluIGdpdCI7fQ== You must remove the remote branches first otherwise git will not know how to reference the names of the remote branches and they will remain. Once a branch is merged, for example,. So If you try to remove this branch, you will face following error. It keeps all the various versions in a unique database. This work method prevents the potential conflicts created by merging large bodies of code all at once. You do not need the contents of the branch, only the name for reference. For example, when the users are on the new local v0 branch, The user can type git fetch, git pull, and git push without specifying the origin remote and v0 branch with every command. You can also go to the branches tab and manage or delete branches there. I also create the image below to show the steps: Tip: When you delete branches using git branch -d deletes local branch or git push origin : deletes remote branch only the references are deleted. In order to remove the remote branches your local git needs to know about them. I implemented this, but it appears to remove branches which have been merged, but then later modified, and not remerged — this results in potentially new and unique code being deleted. But still it continues to show up. I recently downloaded a pre-release version of Git Extensions that has a pane with branches. This opens a new window. Include a single-sentence summary of your changes. Below are examples of how to delete local and remote branches in Git. Keeping a tidy repository is important; not just a tidy codebase, but a tidy repository in as far as not having spare branches rotting around. Here's an example of when git remote prune origin will actually do something: User A does the steps above. Adding and Removing Remote Branches - Git is a way for software developers to track different modifications of their code. A typical way to remove these obsolete remote-tracking branches since Git version 1. After working on a project for a while you wind up with lots of feature and hotfix branches. If you are working on a team with a remote cannonical project repo there will likely be dozens or hundreds of stale branches that need pruning. Here are a few quick commands that will help you clean up your branches. You must remove the remote branches first otherwise git will not know how to reference delete remote branch in git names of the remote branches and they will remain. delete remote branch in git Get a list of branches Chances are if you are working with a team you will not have all of the remote repo branches locally. In order to remove the remote branches your local git needs to know about them. This command will pull a list of the remote branches without fully checking them out. You do not need the contents of the branch, only the name for reference. I will test this in the future on another cleanup. This will confuse the remote repo during the delete operation. The xargs command passes the branch names with their manipulations to the git command: xargs -n 1 git push --delete origin Remove merged local branches Local branches that have been merged into master should generally be safe to remove and can easily be accomplished via: git branch --merged master grep -v master xargs -n 1 git branch -d Per command breakdown Get a list of all branches that have been merged into the master branch: git branch --merged master Just to be safe cut out the master branch from the previous output if it exists: grep -v master Finally you can call the git command to delete the remote branch. The xargs command passes the branch names with their manipulations to the git command: xargs -n 1 git branch -d This is a nifty looking tool, however I do not think it fits my current scenario too well. It looks like this tool requires you to pass it a number of days before something is considered obsolete. On the projects I am working with the branches may be around for a while before being merged into the production branch. Thus time does not matter and the only metric I have to go on is merge status with the production branch. I implemented this, but it appears to remove branches which have been merged, but then later modified, and not remerged — this results in potentially new and unique code being deleted. Can you think of a way to modify this which would result in unique remote branches which have been previously merged being spared?.