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

Re: user manual question

From
Markus Heidelberg <markus.heidelberg@web.de>
Date
Dec 29, 2008, 17:20 UTC
Message-ID
<200812291820.58642.markus.heidelberg@web.de>
In-Reply-To
<gjauel$94s$4@ger.gmane.org>
Zorba, 29.12.2008:
> so a detached HEAD is just a HEAD that is not sitting on a tip ?

You can also get a detached HEAD with "git checkout origin/master", although your HEAD points to a tip. But it's a remote tip and since you can't work on remote branches, you now are on a detached HEAD (no branch).

Show 5 quoted lines
> i.e. if I do $ git reset --hard HEAD^
> 
> ...pointing HEAD to the previous committ
> 
> this is a detached HEAD

No, this isn't. "git reset <commit>" modifies your current head (local branch), now HEAD still points to the tip, but the tip is one commit older. A detached HEAD you can get with "git checkout HEAD^".

Previous: Björn SteinbrinkNext: Sitaram Chamarty
Message 10 of 12 in “user manual question”
  1. ZorbaDec 28, 2008
  2. Sitaram ChamartyDec 28, 2008
  3. Dilip MDec 28, 2008
  4. ZorbaDec 29, 2008
  5. ZorbaDec 28, 2008
  6. Sitaram ChamartyDec 29, 2008
  7. Dilip MDec 29, 2008
  8. ZorbaDec 29, 2008
  9. Björn SteinbrinkDec 29, 2008
  10. Markus HeidelbergDec 29, 2008
  11. Sitaram ChamartyDec 29, 2008
  12. Daniel BarkalowDec 29, 2008

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.