{"thread":{"id":"24964","subject":"Checking out a branch in another directory","startedAt":"2010-09-03T22:10:52Z","lastAt":"2010-09-03T22:23:51Z","messageCount":2,"participants":["Luben Tuikov","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"149792","messageId":"800379.5243.qm@web31805.mail.mud.yahoo.com","threadId":"24964","inReplyTo":null,"subject":"Checking out a branch in another directory","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2010-09-03T22:10:52Z","receivedAt":"2010-09-03T22:10:52Z","isPatch":false,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"I'd like to checkout a branch and work on it and so on, but *in another directory*.  I wasn't able to accomplish this with git clone, as I can see that refs/heads were NOT shared as also indicated by .git/config, local and/or shared.\n\nIs there official tools to do this in master?\n\nI basically want to eliminate having to do git-checkout <branch> and instead simply do a cd ../<branch>, but really have just a single history.\n\nFor the last 4 years, I've been using a home-brewed git-mkdir-of-branch.sh from a local branch, which basically creates a bunch of symlinks and then runs git-read-tree HEAD; git-checkout-index -u -q -f -a.\n\n   Luben\n"},{"id":"149794","messageId":"20100903222351.GA26237@burratino","threadId":"24964","inReplyTo":"800379.5243.qm@web31805.mail.mud.yahoo.com","subject":"Re: Checking out a branch in another directory","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-09-03T22:23:51Z","receivedAt":"2010-09-03T22:23:51Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi Luben,\n\nLuben Tuikov wrote:\n\n> For the last 4 years, I've been using a home-brewed\n> git-mkdir-of-branch.sh from a local branch, which basically creates\n> a bunch of symlinks and then runs git-read-tree HEAD;\n> git-checkout-index -u -q -f -a.\n\nYou might like contrib/workdir/git-new-workdir (shipped in\n/usr/share/doc/git by most distros).\n\nAn occasional topic has been how to integrate this functionality\ninto \"git clone\".  See [1], for example.\n\nGood luck,\nJonathan\n\n[1] http://thread.gmane.org/gmane.comp.version-control.git/150559/focus=151247\n"}]}