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

Re: Detached HEAD warning (again)

From
PBPieter de Bie <pdebie@ai.rug.nl>
Date
Mar 31, 2009, 17:59 UTC
Message-ID
<D561809D-BEE9-417A-B030-8337533C8E53@ai.rug.nl>
In-Reply-To
<alpine.DEB.1.00.0903311203490.10279@pacific.mpi-cbg.de>
On Mar 31, 2009, at 11:04 AM, Johannes Schindelin wrote:
Show 13 quoted lines
>> 	$ git submodule update --init
>> 	# sub/ is created
>> 	$ (cd sub && touch a && git add a && git commit -am "Add new file")
>> 	[detached HEAD 8641889] Add new file
>> 	 0 files changed, 0 insertions(+), 0 deletions(-)
>> 	 create mode 100644 a
>>
>> 	$ git submodule update
>> 	$ ls sub/a
>> 	ls: sub/a: No such file or directory
>
> 	$ cd sub
> 	$ git checkout HEAD@{1}

Yes, I know that the commits can still be recovered (otherwise this would be a much bigger issue), but 'git reflog' has never been a necessary part of a workflow, has it? It's nifty and can be very useful in situations where you accidentally lost something, but you can hardly call this a nice workflow or expect people that use submodules to know about this.

- Pieter
Previous: Johannes SchindelinNext: Junio C Hamano
Message 3 of 4 in “Detached HEAD warning (again)”
  1. Pieter de BieMar 30, 2009
  2. Johannes SchindelinMar 31, 2009
  3. Pieter de BieMar 31, 2009
  4. Junio C HamanoApr 1, 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.