# checkout detached work tree

2 messages from 2008-03-18 to 2008-03-20. Participants: Jörg Sommer, Nguyen Thai Ngoc Duy.
Thread: https://gitlist.dev/t/12754

## Jörg Sommer, 2008-03-18 23:32

Subject: checkout detached work tree
Message-ID: <slrnfu0k9d.kfv.joerg@alea.gnuu.de>
URL: https://gitlist.dev/e/slrnfu0k9d.kfv.joerg%40alea.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)

```

## Nguyen Thai Ngoc Duy, 2008-03-20 15:01

Subject: Re: checkout detached work tree
Message-ID: <fcaeb9bf0803200801y45255591t5c0e9505399cbb30@mail.gmail.com>
URL: https://gitlist.dev/e/fcaeb9bf0803200801y45255591t5c0e9505399cbb30%40mail.gmail.com
In-Reply-To: <slrnfu0k9d.kfv.joerg@alea.gnuu.de>

```
On Wed, Mar 19, 2008 at 6:32 AM, Jörg Sommer <joerg@alea.gnuu.de> wrote:
> 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?

Works well here with version 1.5.4.2.281.g28d0e. What version were you using?
-- 
Duy

```
