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

Re: Why can't git-rebase back up?

From
Junio C Hamano <junkio@cox.net>
Date
Feb 18, 2006, 07:39 UTC
Message-ID
<7vhd6xru8h.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<43F5FA10.5020605@op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 8 quoted lines
> The order of precedence works as such:
> .git/<anchor-name>
> .git/refs/<anchor-name>
> .git/refs/tags/<tag-name>
> .git/refs/heads/<branch-name>
> sha1, with git magic to allow abbreviations
>
> This is why you can't sanely have a branch named HEAD.
Actually, you should be able to sanely have a branch named HEAD.

When git barebone Porcelain tools _expect_ branch name from the user (not just a random committish), they _ought_ to prefix "refs/heads" in front of it, exactly in order to help disambiguate things.

Otherwise you have spotted a bug, so please send in a fix.

It is however a different story if you can keep your sanity if you created a branch called HEAD. You have to remember to explicitly say refs/heads/HEAD, where a command wants any committish or treeish.

Previous: Andreas EricssonNext: Junio C Hamano
Message 5 of 10 in “Why can't git-rebase back up?”
  1. linux@horizon.comFeb 17, 2006
  2. Andreas EricssonFeb 17, 2006
  3. linux@horizon.comFeb 17, 2006
  4. Andreas EricssonFeb 17, 2006
  5. Junio C HamanoFeb 18, 2006
  6. Junio C HamanoFeb 18, 2006
  7. linux@horizon.comFeb 18, 2006
  8. Junio C HamanoFeb 18, 2006
  9. linux@horizon.comFeb 18, 2006
  10. Johannes SchindelinFeb 18, 2006

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.