{"thread":{"id":"22462","subject":"GIT_WORK_TREE environment variable not working","startedAt":"2010-02-01T01:33:47Z","lastAt":"2010-02-01T07:09:25Z","messageCount":3,"participants":["Ron Garret","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133211","messageId":"ron1-8E7697.17334731012010@news.gmane.org","threadId":"22462","inReplyTo":null,"subject":"GIT_WORK_TREE environment variable not working","fromName":"Ron Garret","fromEmail":"ron1@flownet.com","sentAt":"2010-02-01T01:33:47Z","receivedAt":"2010-02-01T01:33:47Z","isPatch":false,"sender":{"key":"ron1@flownet.com","avatar":null},"body":"What am I doing wrong here?\n\n[ron@mickey:~/devel/gittest]$ pwd\n/Users/ron/devel/gittest\n[ron@mickey:~/devel/gittest]$ git status\n# On branch master\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#  git/\nnothing added to commit but untracked files present (use \"git add\" to \ntrack)\n[ron@mickey:~/devel/gittest]$ cd\n[ron@mickey:~]$ export GIT_WORK_TREE=/Users/ron/devel/gittest\n[ron@mickey:~]$ git status\nfatal: Not a git repository (or any of the parent directories): .git\n[ron@mickey:~]$ git status --work-tree=/Users/ron/devel/gittest\nfatal: Not a git repository (or any of the parent directories): .git\n[ron@mickey:~]$\n"},{"id":"133220","messageId":"20100201051942.GA7761@coredump.intra.peff.net","threadId":"22462","inReplyTo":"ron1-8E7697.17334731012010@news.gmane.org","subject":"Re: GIT_WORK_TREE environment variable not working","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-02-01T05:19:42Z","receivedAt":"2010-02-01T05:19:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 31, 2010 at 05:33:47PM -0800, Ron Garret wrote:\n\n> What am I doing wrong here?\n> \n> [ron@mickey:~/devel/gittest]$ pwd\n> /Users/ron/devel/gittest\n> [ron@mickey:~/devel/gittest]$ git status\n> # On branch master\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> #  git/\n> nothing added to commit but untracked files present (use \"git add\" to \n> track)\n> [ron@mickey:~/devel/gittest]$ cd\n> [ron@mickey:~]$ export GIT_WORK_TREE=/Users/ron/devel/gittest\n> [ron@mickey:~]$ git status\n> fatal: Not a git repository (or any of the parent directories): .git\n> [ron@mickey:~]$ git status --work-tree=/Users/ron/devel/gittest\n> fatal: Not a git repository (or any of the parent directories): .git\n> [ron@mickey:~]$\n\nYou haven't told git where to find the repository itself. GIT_WORK_TREE\nis about saying \"here are my work tree files\", but it is explicitly not\nabout \"here is where my .git directory is\". That lets you keep the two\nin totally separate locations. E.g., you could do something like\ntracking /etc, but keep your .git directory in /var.\n\nFor your case above, you would want to also\n\n  export GIT_DIR=/Users/ron/devel/gittest/.git\n\nthough since you have a fully formed repository, I don't think there is\nreally any advantage over just doing:\n\n  cd /Users/ron/devel/gittest && git $whatever\n\nthough perhaps that is because this is not a real use case, but rather\njust you trying to figure out the feature. :)\n\n-Peff\n"},{"id":"133223","messageId":"ron1-EF4205.23092531012010@news.gmane.org","threadId":"22462","inReplyTo":"20100201051942.GA7761@coredump.intra.peff.net","subject":"Re: GIT_WORK_TREE environment variable not working","fromName":"Ron Garret","fromEmail":"ron1@flownet.com","sentAt":"2010-02-01T07:09:25Z","receivedAt":"2010-02-01T07:09:25Z","isPatch":false,"sender":{"key":"ron1@flownet.com","avatar":null},"body":"In article <20100201051942.GA7761@coredump.intra.peff.net>,\n Jeff King <peff@peff.net> wrote:\n\n> On Sun, Jan 31, 2010 at 05:33:47PM -0800, Ron Garret wrote:\n> \n> > What am I doing wrong here?\n> > \n> > [ron@mickey:~/devel/gittest]$ pwd\n> > /Users/ron/devel/gittest\n> > [ron@mickey:~/devel/gittest]$ git status\n> > # On branch master\n> > # Untracked files:\n> > #   (use \"git add <file>...\" to include in what will be committed)\n> > #\n> > #  git/\n> > nothing added to commit but untracked files present (use \"git add\" to \n> > track)\n> > [ron@mickey:~/devel/gittest]$ cd\n> > [ron@mickey:~]$ export GIT_WORK_TREE=/Users/ron/devel/gittest\n> > [ron@mickey:~]$ git status\n> > fatal: Not a git repository (or any of the parent directories): .git\n> > [ron@mickey:~]$ git status --work-tree=/Users/ron/devel/gittest\n> > fatal: Not a git repository (or any of the parent directories): .git\n> > [ron@mickey:~]$\n> \n> You haven't told git where to find the repository itself. GIT_WORK_TREE\n> is about saying \"here are my work tree files\", but it is explicitly not\n> about \"here is where my .git directory is\". That lets you keep the two\n> in totally separate locations. E.g., you could do something like\n> tracking /etc, but keep your .git directory in /var.\n> \n> For your case above, you would want to also\n> \n>   export GIT_DIR=/Users/ron/devel/gittest/.git\n\nAh.  Thanks!\n\n> though since you have a fully formed repository, I don't think there is\n> really any advantage over just doing:\n> \n>   cd /Users/ron/devel/gittest && git $whatever\n> \n> though perhaps that is because this is not a real use case, but rather\n> just you trying to figure out the feature. :)\n\nIt's a real use case.  The situation is that I'm using git as a back end \nfor an IDE, so I can't rely on the cwd.\n\nrg\n"}]}