Delete a remote branch in Git
12/17/2010
I run into this all the time. I am typing too fast when I push code to my remote repository and I make a typo that creates a new branch in my remote repository.
Correct: git push origin production:refs/heads/production
Mistake: git push origin production:ref/heads/production
Result: * [new branch] production -> ref/heads/production
Obviously I do not want this new branch on my remote server, so I want to remove it. You can remove this newly created branch with.
The Fix: git push origin :ref/heads/production
Tags
1and1
Apache
Audio
Austin Hill
Automator
Budget Travel
Career
cloud foundry
Community
Consulting
Cyberduck
Debian
Development
Drupal
EC2
European Travel
Eurotrip
ffmpegx
Framework
Git
git-http-backend
github
GiveMeaning
Image
Mac
Macports
Memcached
Mesh Conference
mod_python
Mongrel
Mongrel Cluster
Mouse Gestures
MySQL
NginX
node.js
Package Management
Parallels
Philanthropy
PHP
Preview
Python
Rails
Rapid Development
Relational Scaling
Resize
Rip
RoR
Ruby On Rails
S3
Satchmo
SimpleDB
SQS
Textmate
Tom Williams
Trends
Ubuntu
Web
Web Services
Wordpress
Workflow
Will Stevens
I am a software developer with a primary focus on web applications. I am always trying to find new and better ways to solve business problems with elegant software.

