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

Re: [BUG?] Detaching head at checked out point does not work.

From
Junio C Hamano <junkio@cox.net>
Date
May 12, 2007, 18:26 UTC
Message-ID
<7v7ird2902.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070512172105.GB32764@efreet.light.src>
Jan Hudec <bulb@ucw.cz> writes:
Show 9 quoted lines
> Hello,
>
> I can correctly detach head by saying:
>
>   git checkout master^0
>
> (or git checkout master^{} or git checkout refs/heads/master), but NONE of
> these work, if I currently have master checked out. Shouldn't it detach
> anyway?
Yes, and it does as far as I know.
Do you have 3e0318a3?
commit 3e0318a3613ae8e89dcb1fc39d909145e64287b9
Author: Junio C Hamano <junkio@cox.net>
Date:   Thu Mar 29 01:02:50 2007 -0700
    checkout: allow detaching to HEAD even when switching to the tip of a branch
    
    You cannot currently checkout the tip of an existing branch
    without moving to the branch.
    
    This allows you to detach your HEAD and place it at such a
    commit, with:
    
        $ git checkout master^0
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
Previous: Jan HudecNext: Jan Hudec
Message 2 of 5 in “[BUG?] Detaching head at checked out point does not work.”
  1. Jan HudecMay 12, 2007
  2. Junio C HamanoMay 12, 2007
  3. Jan HudecMay 12, 2007
  4. Junio C HamanoMay 12, 2007
  5. Jan HudecMay 12, 2007

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.