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

`git status` output is very misleading after a merge on a "detached HEAD"

From
EBEnis Bayramoğlu <enis@picussecurity.com>
Date
Apr 11, 2017, 08:57 UTC
Message-ID
<CAMLReHYBVmuu5H015N1ShCD0iLNau9oLOabJhQ7xc=58rXQi+Q@mail.gmail.com>

I've encountered a very misleading output from `git status`. Here's a sequence of events that demonstrates the issue:

$ git --version git version 2.12.0

$ git checkout origin/master

$ git status HEAD detached from origin/master nothing to commit, working directory clean

$ git merge --ff f3515b749be861b57fc70c2341c1234eeb0d5b87

$ git status HEAD detached from origin/master nothing to commit, working directory clean

$ git rev-parse origin/master e1dc1baaadee0f1aef2d5c45d068306025d11f67

$ git rev-parse HEAD 786cb6dd09897e0950a2bdc971f0665a059efd33

I think it's extremely misleading that `git status` simply reports "HEAD detached from origin/master" while this simply happens to be a mildly relevant fact about some past state.

Thanks and regards
Next: Michael J Gruber
Message 1 of 11 in “`git status` output is very misleading after a merge on a "detached HEAD"”
  1. Enis BayramoğluApr 11, 2017
  2. Michael J GruberApr 11, 2017
  3. Enis BayramoğluApr 11, 2017
  4. Ævar Arnfjörð BjarmasonApr 11, 2017
  5. Michael J GruberApr 12, 2017
  6. Enis BayramoğluApr 12, 2017
  7. Michael J GruberApr 12, 2017
  8. Ævar Arnfjörð BjarmasonApr 12, 2017
  9. Michael J GruberApr 12, 2017
  10. Ævar Arnfjörð BjarmasonApr 12, 2017
  11. Philip OakleyApr 14, 2017

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.