git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] push: don't guess at qualifying remote refs on deletion

From
Carlos Martín Nieto <cmn@elego.de>
Date
Jul 5, 2012, 07:22 UTC
Message-ID
<1341472926.10752.5.camel@flaca.cmartin.tk>
In-Reply-To
<CABURp0rVPAvxP1sp_nmoNYd+F+OsvWeHgUAeo7-VTnQhdebFeg@mail.gmail.com>
On Wed, 2012-07-04 at 22:23 -0400, Phil Hord wrote:
Show 48 quoted lines
> 
> On Jul 4, 2012 3:22 AM, "Carlos Martín Nieto" <cmn@elego.de> wrote:
> >
> > On Tue, 2012-07-03 at 14:40 -0400, Jeff King wrote:
> > > On Tue, Jul 03, 2012 at 02:34:59PM -0400, jonsmirl@gmail.com
> wrote:
> > >
> > > > > and now:
> > > > >
> > > > >   $ git push origin :bogus
> > > > >   error: unable to delete 'bogus': remote ref does not exist
> > > > >   error: failed to push some refs to '$URL'
> > > >
> > > > This error return would have made my mistake obvious.
> > >
> > > Thanks for confirming.
> > >
> > > > Might want to add a paragraph to the doc saying this is how you
> delete
> > > > remote branches since it is not an obvious solution. I found it
> via
> > > > Google and a question asked on stackoverflow.com
> > >
> > > It's already in git-push(1):
> > >
> > >   OPTIONS
> > >      ...
> > >      <refspec>
> > >        ...
> > >        Pushing an empty <src> allows you to delete the <dst> ref
> from
> > >        the remote repository.
> > >
> >
> > There is also a flag you can pass, which you can see a few
> paragraphs
> > under it which. It explains what it does underneath but removes the
> need
> > to know that an empty source will delete the ref.
> >
> >     --delete
> >        All listed refs are deleted from the remote repository. This
> is
> >        the same as prefixing all refs with a colon.
> 
> 
> I do like that, but I agree with OP that 'git push' is not an obvious
> to look for delete branch functionality for new users.

Like it? I don't get what you mean, it's a quote of what's already there.

The reason that it's in git-push is because that's the only git command that modifies another repository. There isn't another git command where it would fit. You could try to put it somewhere under git-remote, but then you'd have a single subcommand that affects a remote among a lot of others that don't, introducing an inconsistency in the command.

   cmn
Previous: Junio C HamanoNext: Phil Hord
Message 14 of 17 in “How do I delete a remote branch with a period in the name?”
  1. jonsmirl@gmail.comJul 3, 2012
  2. Junio C HamanoJul 3, 2012
  3. jonsmirl@gmail.comJul 3, 2012
  4. push: don't guess at qualifying remote refs on deletionJeff King, Jul 3, 2012
  5. jonsmirl@gmail.comJul 3, 2012
  6. Jeff KingJul 3, 2012
  7. jonsmirl@gmail.comJul 3, 2012
  8. Jeff KingJul 3, 2012
  9. Carlos Martín NietoJul 4, 2012
  10. Junio C HamanoJul 3, 2012
  11. Jeff KingJul 4, 2012
  12. Andreas SchwabJul 3, 2012
  13. Junio C HamanoJul 3, 2012
  14. Carlos Martín NietoJul 5, 2012
  15. Phil HordJul 5, 2012
  16. Carlos Martín NietoJul 5, 2012
  17. Junio C HamanoJul 5, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.