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

Re: remote branches, and branch names in general

From
Jay Soffian <jaysoffian@gmail.com>
Date
Mar 3, 2009, 19:32 UTC
Message-ID
<76718490903031132v592b8368p6355ea2bd0cda4ae@mail.gmail.com>
In-Reply-To
<20090303161117.GB32079@coredump.intra.peff.net>
On Tue, Mar 3, 2009 at 11:11 AM, Jeff King <peff@peff.net> wrote:
> Yes, the "branch" command deals only with creating things in refs/heads,

Unless given -r, in which case it looks in refs/remotes, or -a, in which case it looks in refs/heads and refs/remotes. :-)

> which are your local branches (similarly, "git tag" will only deal with
> stuff in refs/tags). So "git branch origin/foo" will make a ref
> "refs/heads/origin/foo", and "git branch -d origin/foo" will delete
> "refs/heads/origin/foo", not "refs/remotes/origin/foo".

For the latter, use git branch -d -r origin/foo. I'm not sure whether -r is usable when creating a branch, I haven't tried.

j.
Previous: Jeff KingNext: Jeff King
Message 8 of 9 in “remote branches, and branch names in general”
  1. John DlugoszMar 2, 2009
  2. Jakub NarebskiMar 3, 2009
  3. Jeff KingMar 3, 2009
  4. Markus HeidelbergMar 3, 2009
  5. Jeff KingMar 3, 2009
  6. John DlugoszMar 3, 2009
  7. Jeff KingMar 3, 2009
  8. Jay SoffianMar 3, 2009
  9. Jeff KingMar 4, 2009

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.