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

checkout detached work tree

From
JSJörg Sommer <joerg@alea.gnuu.de>
Date
Mar 18, 2008, 23:32 UTC
Message-ID
<slrnfu0k9d.kfv.joerg@alea.gnuu.de>
Hi,
is it correct that this checkout fails?

% git --git-dir=$HOME/git/git/.git --work-tree=/tmp/git symbolic-ref HEAD refs/heads/master % git --git-dir=$HOME/git/git/.git --work-tree=/tmp/git checkout fatal: /usr/bin/git-checkout cannot be used without a working tree.

I want to do a checkout in a script without need to worry about the current working directory. But it seams this is not possible. Many commands fail. Is this behaviour expected?

Bye, Jörg.
-- 
Als deutscher Tourist im Ausland steht man vor der Frage, ob man sich
anständig benehmen muss oder ob schon deutsche Touristen dagewesen sind.
	  	   	     	      	        (Kurt Tucholsky)
Next: Nguyen Thai Ngoc Duy
Message 1 of 2 in “checkout detached work tree”
  1. Jörg SommerMar 18, 2008
  2. Nguyen Thai Ngoc DuyMar 20, 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.