{"thread":{"id":"36449","subject":"the \".git\" folder","startedAt":"2014-04-20T09:13:50Z","lastAt":"2014-04-20T22:13:57Z","messageCount":4,"participants":["Miller, Hugh","Duy Nguyen","Kevin","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"239143","messageId":"7F780F951A13B047BB0CE5F6EA9069C121871366@hou150w8xmbx06.hou150.chevrontexaco.net","threadId":"36449","inReplyTo":null,"subject":"the \".git\" folder","fromName":"Miller, Hugh","fromEmail":"hughmiller@chevron.com","sentAt":"2014-04-20T09:13:50Z","receivedAt":"2014-04-20T09:13:50Z","isPatch":false,"sender":{"key":"hughmiller@chevron.com","avatar":null},"body":"Dear Community,\n\nIs there any way to use .git (e.g., a different set of \"client\" commands) that allows the .git folder to be placed in a location away from the actual files being versioned ? For example, can one set environment variables that let the software know where the .git folder is ?\n\nReason for asking - the files being versioned are acted on other applications that know nothing about git, so presence of .git in the file directory may cause problems.\n\nThanks,\n\nHugh Miller\n"},{"id":"239144","messageId":"CACsJy8CXADh_wrHeqf47FuBUiF8pq_xboUPnts6mP8iVj0F-Pg@mail.gmail.com","threadId":"36449","inReplyTo":"7F780F951A13B047BB0CE5F6EA9069C121871366@hou150w8xmbx06.hou150.chevrontexaco.net","subject":"Re: the \".git\" folder","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-04-20T09:49:44Z","receivedAt":"2014-04-20T09:49:44Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Apr 20, 2014 at 4:13 PM, Miller, Hugh <HughMiller@chevron.com> wrote:\n> Dear Community,\n>\n> Is there any way to use .git (e.g., a different set of \"client\" commands) that allows the .git folder to be placed in a location away from the actual files being versioned ? For example, can one set environment variables that let the software know where the .git folder is ?\n\nTry\n\ngit --git-dir=<new .git location> --work-tree=<top work tree location>\n<some command>\n\nThe reason of two arguments instead of one is because .git is also\nused to mark top work tree location, which is now lost after you move\n.git elsewhere. You could also set environment variables GIT_DIR and\nGIT_WORK_TREE, which have the same effect. \"man git\" for details.\n-- \nDuy\n"},{"id":"239146","messageId":"CAO54GHCQBDehPsneMW4Q8CTm+OJUhVpq_higzKDows4TgpJFOw@mail.gmail.com","threadId":"36449","inReplyTo":"CACsJy8CXADh_wrHeqf47FuBUiF8pq_xboUPnts6mP8iVj0F-Pg@mail.gmail.com","subject":"Re: the \".git\" folder","fromName":"Kevin","fromEmail":"ikke@ikke.info","sentAt":"2014-04-20T12:58:57Z","receivedAt":"2014-04-20T12:58:57Z","isPatch":false,"sender":{"key":"ikke@ikke.info","avatar":"https://gravatar.com/avatar/60a0d08eeccb16914fdbfc7f3441548dc827dc436d5c6900ec6600e274e53c5b?d=mp&s=160"},"body":"Another way, which wouldn't require environment variables or extra\nparameters for each command is moving the .git directory, and replace\nit with a file called .git, which has the path to the actual .git\ndirectory.\n\nGit submodules use this feature too.\n\nOn Sun, Apr 20, 2014 at 11:49 AM, Duy Nguyen <pclouds@gmail.com> wrote:\n> On Sun, Apr 20, 2014 at 4:13 PM, Miller, Hugh <HughMiller@chevron.com> wrote:\n>> Dear Community,\n>>\n>> Is there any way to use .git (e.g., a different set of \"client\" commands) that allows the .git folder to be placed in a location away from the actual files being versioned ? For example, can one set environment variables that let the software know where the .git folder is ?\n>\n> Try\n>\n> git --git-dir=<new .git location> --work-tree=<top work tree location>\n> <some command>\n>\n> The reason of two arguments instead of one is because .git is also\n> used to mark top work tree location, which is now lost after you move\n> .git elsewhere. You could also set environment variables GIT_DIR and\n> GIT_WORK_TREE, which have the same effect. \"man git\" for details.\n> --\n> Duy\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n"},{"id":"239193","messageId":"7v38h7lkd6.fsf@alter.siamese.dyndns.org","threadId":"36449","inReplyTo":"CACsJy8CXADh_wrHeqf47FuBUiF8pq_xboUPnts6mP8iVj0F-Pg@mail.gmail.com","subject":"Re: the \".git\" folder","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-04-20T22:13:57Z","receivedAt":"2014-04-20T22:13:57Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Duy Nguyen <pclouds@gmail.com> writes:\n\n> On Sun, Apr 20, 2014 at 4:13 PM, Miller, Hugh <HughMiller@chevron.com> wrote:\n>> Dear Community,\n>>\n>> Is there any way to use .git (e.g., a different set of \"client\" commands) that allows the .git folder to be placed in a location away from the actual files being versioned ? For example, can one set environment variables that let the software know where the .git folder is ?\n>\n> Try\n>\n> git --git-dir=<new .git location> --work-tree=<top work tree location>\n> <some command>\n>\n> The reason of two arguments instead of one is because .git is also\n> used to mark top work tree location, which is now lost after you move\n> .git elsewhere. You could also set environment variables GIT_DIR and\n> GIT_WORK_TREE, which have the same effect. \"man git\" for details.\n\nDepending on the true reason why such a split layout is desired, the\nanswer might be the textual .git (aka \"gitfile: there\") that is used\nby the submodule folks via \"clone --separate-git-dir\".\n"}]}