{"thread":{"id":"9392","subject":"$GIT_DIR usage","startedAt":"2007-08-05T09:58:59Z","lastAt":"2007-08-05T13:41:28Z","messageCount":6,"participants":["Dan Zwell","Johannes Schindelin","Dmitry Kakurin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"49863","messageId":"46B59F63.8020707@gmail.com","threadId":"9392","inReplyTo":null,"subject":"$GIT_DIR usage","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-08-05T09:58:59Z","receivedAt":"2007-08-05T09:58:59Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Hi, I had a question about $GIT_DIR. That is to say, it doesn't seem to \nwork. I am using Git 1.5.2.4. See the following: (all the commands I \ntried besides \"git-init\" failed).\n\n$ export GIT_DIR=\"`pwd`/.git_public\"\n$ git init\nwarning: templates not found /usr/share//git-core/templates/\nInitialized empty Git repository in /home/user/temp/.git_public/\n$ echo > new_file\n$ git add new_file\nfatal: add must be run in a work tree\n$ git commit -a\nfatal: /usr/bin/git-commit cannot be used without a working tree.\n$ git commit\nfatal: /usr/bin/git-commit cannot be used without a working tree.\n$\n\nIs $GIT_DIR not meant to be used this way? Does it have a different \npurpose / use case, or is this just a bug?\n\nThanks,\nDan\n"},{"id":"297562","messageId":"678E8953ECEB4B72A99DEA2137B05823@ntdev.corp.microsoft.com","threadId":"9392","inReplyTo":"46B59F63.8020707@gmail.com","subject":"Re: $GIT_DIR usage","fromName":"Dmitry Kakurin","fromEmail":"dmitry.kakurin@gmail.com","sentAt":"2007-08-05T11:55:55Z","receivedAt":"2007-08-05T11:55:55Z","isPatch":false,"sender":{"key":"dmitry.kakurin@gmail.com","avatar":null},"body":"I think you also need to set GIT_WORK_TREE.\nThis way Git will know the root of directories that it controls.\n\n- Dmitry\n----- Original Message ----- \nFrom: \"Dan Zwell\" <dzwell@gmail.com>\nNewsgroups: gmane.comp.version-control.git\nTo: <git@vger.kernel.org>\nSent: Sunday, 5 August 2007 2:58\nSubject: $GIT_DIR usage\n\n\n> Hi, I had a question about $GIT_DIR. That is to say, it doesn't seem to \n> work. I am using Git 1.5.2.4. See the following: (all the commands I \n> tried besides \"git-init\" failed).\n> \n> $ export GIT_DIR=\"`pwd`/.git_public\"\n> $ git init\n> warning: templates not found /usr/share//git-core/templates/\n> Initialized empty Git repository in /home/user/temp/.git_public/\n> $ echo > new_file\n> $ git add new_file\n> fatal: add must be run in a work tree\n> $ git commit -a\n> fatal: /usr/bin/git-commit cannot be used without a working tree.\n> $ git commit\n> fatal: /usr/bin/git-commit cannot be used without a working tree.\n> $\n> \n> Is $GIT_DIR not meant to be used this way? Does it have a different \n> purpose / use case, or is this just a bug?\n> \n> Thanks,\n"},{"id":"49877","messageId":"46B5C11E.4000101@gmail.com","threadId":"9392","inReplyTo":"678E8953ECEB4B72A99DEA2137B05823@ntdev.corp.microsoft.com","subject":"Re: $GIT_DIR usage","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-08-05T12:22:54Z","receivedAt":"2007-08-05T12:22:54Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Dmitry Kakurin wrote:\n> I think you also need to set GIT_WORK_TREE.\n> This way Git will know the root of directories that it controls.\n> \n> - Dmitry\n> ----- Original Message ----- From: \"Dan Zwell\" <dzwell@gmail.com>\n> Newsgroups: gmane.comp.version-control.git\n> To: <git@vger.kernel.org>\n> Sent: Sunday, 5 August 2007 2:58\n> Subject: $GIT_DIR usage\n> \n> \n>> Hi, I had a question about $GIT_DIR. That is to say, it doesn't seem \n>> to work. I am using Git 1.5.2.4. See the following: (all the commands \n>> I tried besides \"git-init\" failed).\n>>\n>> $ export GIT_DIR=\"`pwd`/.git_public\"\n>> $ git init\n>> warning: templates not found /usr/share//git-core/templates/\n>> Initialized empty Git repository in /home/user/temp/.git_public/\n>> $ echo > new_file\n>> $ git add new_file\n>> fatal: add must be run in a work tree\n>> $ git commit -a\n>> fatal: /usr/bin/git-commit cannot be used without a working tree.\n>> $ git commit\n>> fatal: /usr/bin/git-commit cannot be used without a working tree.\n>> $\n>>\n>> Is $GIT_DIR not meant to be used this way? Does it have a different \n>> purpose / use case, or is this just a bug?\n>>\n>> Thanks,\n>> Dan\n> \n\nThank you. I also had to upgrade Git to the as-yet unreleased version \n(this variable doesn't exist in the current stable release), but what \nyou said makes sense and seems like it should work.\n\nDan\n"},{"id":"49881","messageId":"Pine.LNX.4.64.0708051332230.14781@racer.site","threadId":"9392","inReplyTo":"46B59F63.8020707@gmail.com","subject":"Re: $GIT_DIR usage","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-05T12:33:22Z","receivedAt":"2007-08-05T12:33:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Aug 2007, Dan Zwell wrote:\n\n> $ export GIT_DIR=\"`pwd`/.git_public\"\n> $ git init\n> warning: templates not found /usr/share//git-core/templates/\n> Initialized empty Git repository in /home/user/temp/.git_public/\n\nI think that you implicitly created a bare repository with that.  Just \ncheck if \"git config core.bare\" returns true.\n\nIf so, you need to change that in order to have a working tree.\n\nHth,\nDscho\n"},{"id":"49884","messageId":"46B5CA50.3050500@gmail.com","threadId":"9392","inReplyTo":"Pine.LNX.4.64.0708051332230.14781@racer.site","subject":"Re: $GIT_DIR usage","fromName":"Dan Zwell","fromEmail":"dzwell@gmail.com","sentAt":"2007-08-05T13:02:08Z","receivedAt":"2007-08-05T13:02:08Z","isPatch":false,"sender":{"key":"dzwell@gmail.com","avatar":null},"body":"Johannes Schindelin wrote:\n> Hi,\n> \n> On Sun, 5 Aug 2007, Dan Zwell wrote:\n> \n>> $ export GIT_DIR=\"`pwd`/.git_public\"\n>> $ git init\n>> warning: templates not found /usr/share//git-core/templates/\n>> Initialized empty Git repository in /home/user/temp/.git_public/\n> \n> I think that you implicitly created a bare repository with that.  Just \n> check if \"git config core.bare\" returns true.\n> \n> If so, you need to change that in order to have a working tree.\n> \n> Hth,\n> Dscho\n> \n> \n\nYou are exactly right, I accidentally created a bare repository. I can \ndo 2 things: I can change core.bare to true, or I can create .git in the \nnormal way, then move rename it. Both things still have the problem of \ngit not knowing where the working directory is. Is the only way to fix \nthis in 1.5.2.4, or is my only option to upgrade?\n\nThanks,\nDan\n"},{"id":"49888","messageId":"Pine.LNX.4.64.0708051440460.14781@racer.site","threadId":"9392","inReplyTo":"46B5CA50.3050500@gmail.com","subject":"Re: $GIT_DIR usage","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-05T13:41:28Z","receivedAt":"2007-08-05T13:41:28Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 5 Aug 2007, Dan Zwell wrote:\n\n> I can do 2 things: I can change core.bare to true, or I can create .git \n> in the normal way, then move rename it. Both things still have the \n> problem of git not knowing where the working directory is. Is the only \n> way to fix this in 1.5.2.4, or is my only option to upgrade?\n\nI really have to ask now: why is ./.git/ not an appropriate name?\n\nCiao,\nDscho\n"}]}