Up North

Personal blog of Mikael Hallendal
  • Home
  • About

Removing a remote branch in Git

Published by Mikael Hallendal on June 21, 2008 05:27 pm under Programming, Tips

This is something I’ve had to checkup a few times so I figured it would be useful both for myself and for others to keep around in a blog post.

To remove a remote branch you created in Git just push to it like:

$ git push origin :name-of-branch
Share This

5 Comments so far

  1. Martin on July 5th, 2008

    Hi,
    I tried it. But I get the error message
    “remote does not support deleting refs”
    I access my remote repository via ssh.

    Do you have any idea, how I enable remote deleting?

    Thanks,
    Martin

  2. Mikael Hallendal on July 15th, 2008

    @Martin, I’m guessing the Git version on your server side is too old. It seems that you need a version of 1.5 or higher.

    See, http://kerneltrap.org/mailarchive/git/2008/7/6/2365674

  3. roma_tr@mail.ru on November 25th, 2008

    Is it possible to forbid that remote branches can be deleted?

  4. Stu on November 29th, 2008

    Great! I’ve been going around in circles with this. Using lots of -r -d and getting “remote branch foo deleted” .. git pull … “new branch foo” aaargh.

    this fixed it right up.

    cheers!

  5. Mikael Hallendal on November 29th, 2008

    @Stu: Really glad it helped!

Posting your comment.


  • Categories

    • Community (3)
    • Imendio (26)
    • Life (13)
    • Photography (1)
    • Press (1)
    • Programming (36)
    • Software (15)
    • Tips (8)
    • Uncategorized (180)
  • Most Popular Posts

    • Removing a remote branch in Git
    • Gtk+ natively on Mac OS X
    • GTK+ 3.0, enabling incrementalism
    • GIMP on Mac OS X with integrated menubar
    • On Nokia 6230 and Palm T5 connectivity
  • Popular Tags

    c conference git gnome gossip gtk+ guadec Imendio linux loudmouth macosx ruby screencast web xmpp
  • My latest tweets

    • Thanks @tannermenard for posting the interview with me http://ping.fm/8nmVp I am not a guru however...just layman ;) 2009-04-02
    • 哈哈。。。 2009-04-01
    • No censorship, tag freely though :) If someone needs censored reality, filter out certain tags they must. 2009-04-01
    • More updates...
  • Feeds

    • Entries
    • Comments

Copyright © 2010 Mikael Hallendal
WordPress Theme based on Light Theme

Close
  • Social Web
  • E-mail
  • del.icio.us
  • Digg
  • Furl
  • Yahoo! My Web
  • StumbleUpon
  • Google Bookmarks
  • Technorati
  • BlinkList
  • Newsvine
  • ma.gnolia
  • reddit
  • Tailrank
  • 9rules Clips
E-mail It