{"thread":{"id":"11638","subject":"I don't want the .git directory next to my code.","startedAt":"2008-01-16T03:27:57Z","lastAt":"2008-01-22T10:27:42Z","messageCount":65,"participants":["Mike","Dan McGee","Nguyen Thai Ngoc Duy","David Symonds","Daniel Barkalow","Randal L. Schwartz","Sean","Luke Lu","Neil Macneale","Mike Krier","Matthieu Moy","Johannes Schindelin","Bill Lear","Jakub Narebski","Bert Wesarg","Junio C Hamano","Linus Torvalds","Wayne Davison","Brian Downing","Sam Vilain","Ping Yin","Martin Langhoff","Kris Shannon","Wincent Colaiuta","Jeff King","Andreas Ericsson","Russ Dill"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"65471","messageId":"478D79BD.7060006@talkingspider.com","threadId":"11638","inReplyTo":null,"subject":"I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T03:27:57Z","receivedAt":"2008-01-16T03:27:57Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\nI'm learning git and I'm really annoyed that the .git directory lives in \nthe same directory as my code.  I don't want it there for three reasons:\n\n1. My code lives on a development web server docroot, and I don't want \nthe .git repository to end up getting published to the live site by \naccident. (I would imagine this would be a common need.)\n\n2. If I tar/gz my code and deliver it to a client, I don't want the .git \ndir slipping into the tarball, allowing my client to be able to peruse \nthe history of what we did and when.\n\n3. The .git respository will get big, especially with binary files in \nit, and I want it someplace with a lot of disk space. And I don't want \nit to get tarred up when we migrate the site to a different server. (And \ntar isn't aware of hard links is it? wonderful.)\n\nHow do I make the repository dir live somewhere else, the hell away from \nmy code? Thanks\n"},{"id":"65481","messageId":"86hcheig3n.fsf@blue.stonehenge.com","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2008-01-16T03:50:20Z","receivedAt":"2008-01-16T03:50:20Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Mike\" == Mike  <fromlists@talkingspider.com> writes:\n\nMike> I'm learning git and I'm really annoyed that the .git directory lives in\nMike> the same directory as my code.  I don't want it there for three reasons:\n\nMike> 1. My code lives on a development web server docroot, and I don't want\nMike> the .git repository to end up getting published to the live site by\nMike> accident. (I would imagine this would be a common need.)\n\nSounds like you need an installer... something that copies your repo into the\nlive location with things you don't want included left out, and all the\npermissions and ownership correct.\n\nMike> 2. If I tar/gz my code and deliver it to a client, I don't want the .git\nMike> dir slipping into the tarball, allowing my client to be able to peruse\nMike> the history of what we did and when.\n\ngit archive --help\n\nMike> 3. The .git respository will get big, especially with binary files in\nMike> it, and I want it someplace with a lot of disk space. And I don't want\nMike> it to get tarred up when we migrate the site to a different server. (And\nMike> tar isn't aware of hard links is it? wonderful.)\n\nAn installer helps here too.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"65473","messageId":"478D8062.3090506@gmail.com","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2008-01-16T03:56:18Z","receivedAt":"2008-01-16T03:56:18Z","isPatch":false,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"On 01/15/2008 09:27 PM, Mike wrote:\n> \n> How do I make the repository dir live somewhere else, the hell away from\n> my code? Thanks\n\nmv .git <location to move to>\nln -s <location moved to> .git\n\nDid you try this before you sent your email?\n\n-Dan\n"},{"id":"65474","messageId":"fcaeb9bf0801152003j54b210edk450d6410109411fd@mail.gmail.com","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2008-01-16T04:03:42Z","receivedAt":"2008-01-16T04:03:42Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Jan 16, 2008 10:27 AM, Mike <fromlists@talkingspider.com> wrote:\n>\n> I'm learning git and I'm really annoyed that the .git directory lives in\n> the same directory as my code.  I don't want it there for three reasons:\n>\n> 1. My code lives on a development web server docroot, and I don't want\n> the .git repository to end up getting published to the live site by\n> accident. (I would imagine this would be a common need.)\n>\n> 2. If I tar/gz my code and deliver it to a client, I don't want the .git\n> dir slipping into the tarball, allowing my client to be able to peruse\n> the history of what we did and when.\n>\n> 3. The .git respository will get big, especially with binary files in\n> it, and I want it someplace with a lot of disk space. And I don't want\n> it to get tarred up when we migrate the site to a different server. (And\n> tar isn't aware of hard links is it? wonderful.)\n>\n> How do I make the repository dir live somewhere else, the hell away from\n> my code? Thanks\n\nSetup GIT_WORK_TREE and GIT_DIR env variables or use --git-dir and\n--work-tree together. See \"man git\" for more detail.\n-- \nDuy\n"},{"id":"65476","messageId":"ee77f5c20801152006w11307ce0j17463f1c6536543f@mail.gmail.com","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2008-01-16T04:06:13Z","receivedAt":"2008-01-16T04:06:13Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Jan 16, 2008 2:27 PM, Mike <fromlists@talkingspider.com> wrote:\n>\n> 2. If I tar/gz my code and deliver it to a client, I don't want the .git\n> dir slipping into the tarball, allowing my client to be able to peruse\n> the history of what we did and when.\n\nUse git-archive.\n\n\nDave.\n"},{"id":"65477","messageId":"478D82FA.2030404@talkingspider.com","threadId":"11638","inReplyTo":"86hcheig3n.fsf@blue.stonehenge.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T04:07:22Z","receivedAt":"2008-01-16T04:07:22Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nRandal L. Schwartz wrote:\n>>>>>> \"Mike\" == Mike  <fromlists@talkingspider.com> writes:\n> \n> \n> Sounds like you need an installer... something that copies your repo into the\n> live location with things you don't want included left out, and all the\n> permissions and ownership correct.\n\nIf you mean copying files from the development webserver to the live \nserver, then the only reason we'd need an installer is because of the \n.git directory, it's the only thing we \"don't want included\".  And as \nfor permissions and ownership, rsync takes care of that.\n\n> \n> git archive --help\n>\n\nI got:\n\n$ git archive --help\nNo manual entry for git-archive\n\nDid I install it wrong?  I have CentOS 5, and I did:\n\nsu\nyum install git\n\nthanks,\nm\n"},{"id":"65478","messageId":"alpine.LNX.1.00.0801152305050.13593@iabervon.org","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-01-16T04:13:58Z","receivedAt":"2008-01-16T04:13:58Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 15 Jan 2008, Mike wrote:\n\n> I'm learning git and I'm really annoyed that the .git directory lives in the\n> same directory as my code.  I don't want it there for three reasons:\n> \n> 1. My code lives on a development web server docroot, and I don't want the\n> .git repository to end up getting published to the live site by accident. (I\n> would imagine this would be a common need.)\n> \n> 2. If I tar/gz my code and deliver it to a client, I don't want the .git dir\n> slipping into the tarball, allowing my client to be able to peruse the history\n> of what we did and when.\n\nGenerate your tarballs with \"git archive\", which will also make sure that \nyou don't accidentally include anything else that's not committed. \nLikewise for sending to the live site, probably.\n\n> 3. The .git respository will get big, especially with binary files in it, and\n> I want it someplace with a lot of disk space. And I don't want it to get\n> tarred up when we migrate the site to a different server. (And tar isn't aware\n> of hard links is it? wonderful.)\n\nYou'll probably want to keep your history, which is what's in .git, when \nyou migrate to a different server; that's kind of the point of using \nversion control...\n\n> How do I make the repository dir live somewhere else, the hell away from my\n> code? Thanks\n\nexport GIT_DIR=/somewhere-else.git\n\nNote that this only really works if you've only got one repository; \nthere's no good way to have the repository information outside of the \nworking directory and still have which repository you're using depend on \nwhich directory you're working in.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"65479","messageId":"478D85A9.6050807@talkingspider.com","threadId":"11638","inReplyTo":"ee77f5c20801152006w11307ce0j17463f1c6536543f@mail.gmail.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T04:18:49Z","receivedAt":"2008-01-16T04:18:49Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\nDavid Symonds wrote:\n> On Jan 16, 2008 2:27 PM, Mike <fromlists@talkingspider.com> wrote:\n>> 2. If I tar/gz my code and deliver it to a client, I don't want the .git\n>> dir slipping into the tarball, allowing my client to be able to peruse\n>> the history of what we did and when.\n> \n> Use git-archive.\n> \n\nThanks but this isn't sufficient. If we have one directory of our web \nroot in a git repository, say docroot/php, and we tar up docroot, it \nwill include php/.git.  We don't want that.  We would have to go out of \nour way to avoid the .git directory.  The point is, we don't want \nanything in docroot that shouldn't be made live.\n"},{"id":"65484","messageId":"ee77f5c20801152024s1a30e5d2o575b74fce2e9e1f1@mail.gmail.com","threadId":"11638","inReplyTo":"478D82FA.2030404@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2008-01-16T04:24:28Z","receivedAt":"2008-01-16T04:24:28Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Jan 16, 2008 3:07 PM, Mike <fromlists@talkingspider.com> wrote:\n>\n>\n> I got:\n>\n> $ git archive --help\n> No manual entry for git-archive\n\nWhat's your git version (\"git version\")? Try just \"man git-archive\".\n\n\nDave.\n"},{"id":"65485","messageId":"478D8717.50100@talkingspider.com","threadId":"11638","inReplyTo":"alpine.LNX.1.00.0801152305050.13593@iabervon.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T04:24:55Z","receivedAt":"2008-01-16T04:24:55Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\nDaniel Barkalow wrote:\n > On Tue, 15 Jan 2008, Mike wrote:\n >\n >\n > Generate your tarballs with \"git archive\", which will also make sure \nthat\n > you don't accidentally include anything else that's not committed.\n > Likewise for sending to the live site, probably.\n\nThanks please see my response to David about why this isn't good.\n\n >\n > You'll probably want to keep your history, which is what's in .git, when\n > you migrate to a different server; that's kind of the point of using\n > version control...\n\nThe git repositories should be on the development server, but should \n*never* be on the live server.  Anywhere, ever.\n\n > export GIT_DIR=/somewhere-else.git\n >\n > Note that this only really works if you've only got one repository;\n > there's no good way to have the repository information outside of the\n > working directory and still have which repository you're using depend on\n > which directory you're working in.\n >\n\nThanks. Damn. We do have several repositories, (several sites).  I'll \ntry Dan's soft link suggestion.\n\nthanks\nm\n"},{"id":"65486","messageId":"478D883B.30203@talkingspider.com","threadId":"11638","inReplyTo":"ee77f5c20801152024s1a30e5d2o575b74fce2e9e1f1@mail.gmail.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T04:29:47Z","receivedAt":"2008-01-16T04:29:47Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n$ man git-archive\nNo manual entry for git-archive\n\nDavid Symonds wrote:\n> \n> What's your git version (\"git version\")? Try just \"man git-archive\".\n\nMike wrote at 10:13PM:\n >\n > git version 1.5.2.1\n\nthanks\n"},{"id":"65488","messageId":"BAYC1-PASMTP143D18D25EC9A59ABD42D7AE400@CEZ.ICE","threadId":"11638","inReplyTo":"478D82FA.2030404@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2008-01-16T04:36:13Z","receivedAt":"2008-01-16T04:36:13Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Tue, 15 Jan 2008 23:07:22 -0500\nMike <fromlists@talkingspider.com> wrote:\n\n\n> > git archive --help\n> >\n> I got:\n> \n> $ git archive --help\n> No manual entry for git-archive\n> \n> Did I install it wrong?  I have CentOS 5, and I did:\n> \n> su\n> yum install git\n> \n\nYes, on Centos you probably need \"yum install git-core\"  which installs all\nthe assorted pieces and dependencies of Git.\n\nHTH,\nSean\n"},{"id":"65490","messageId":"alpine.LNX.1.00.0801152337140.13593@iabervon.org","threadId":"11638","inReplyTo":"478D85A9.6050807@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2008-01-16T04:44:19Z","receivedAt":"2008-01-16T04:44:19Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 15 Jan 2008, Mike wrote:\n\n> David Symonds wrote:\n> > On Jan 16, 2008 2:27 PM, Mike <fromlists@talkingspider.com> wrote:\n> > > 2. If I tar/gz my code and deliver it to a client, I don't want the .git\n> > > dir slipping into the tarball, allowing my client to be able to peruse\n> > > the history of what we did and when.\n> > \n> > Use git-archive.\n> > \n> \n> Thanks but this isn't sufficient. If we have one directory of our web root in\n> a git repository, say docroot/php, and we tar up docroot, it will include\n> php/.git.  We don't want that.  We would have to go out of our way to avoid\n> the .git directory.  The point is, we don't want anything in docroot that\n> shouldn't be made live.\n\nI don't know about you, but my source directories get lots of other \njunk: editor backup files, half-written scripts, debugging output, etc. \nFurthermore, there's the issue of whether you can accidentally distribute \nsomething you haven't added to your version control yet and therefore \ncan't reproduce. It's just a lot cleaner to deploy and distribute out of \nthe version control system instead of out of a working directory.\n\nI don't know why you don't seem to have git-archive (or its manpage); it's \nin the version you have. Maybe it didn't get into the deb-generation files \nat the time? You might have git-tar-tree instead, though.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"65491","messageId":"D017F6F6-D674-428B-936B-181BF20CF4B5@vicaya.com","threadId":"11638","inReplyTo":"478D85A9.6050807@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Luke Lu","fromEmail":"git@vicaya.com","sentAt":"2008-01-16T04:55:49Z","receivedAt":"2008-01-16T04:55:49Z","isPatch":false,"sender":{"key":"git@vicaya.com","avatar":null},"body":"\nOn Jan 15, 2008, at 8:18 PM, Mike wrote:\n\n>\n> David Symonds wrote:\n>> On Jan 16, 2008 2:27 PM, Mike <fromlists@talkingspider.com> wrote:\n>>> 2. If I tar/gz my code and deliver it to a client, I don't want  \n>>> the .git\n>>> dir slipping into the tarball, allowing my client to be able to  \n>>> peruse\n>>> the history of what we did and when.\n>> Use git-archive.\n>\n> Thanks but this isn't sufficient. If we have one directory of our  \n> web root in a git repository, say docroot/php, and we tar up  \n> docroot, it will include php/.git.  We don't want that.  We would  \n> have to go out of our way to avoid the .git directory.  The point  \n> is, we don't want anything in docroot that shouldn't be made live.\n\ngit-archive generates an archive file *without* the .git directory.  \n From git-archive(1):\n\n   git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ &&  \ntar xf -)\n               Create a tar archive that contains the contents of the  \nlatest\n               commit on the current branch, and extracts it in /var/ \ntmp/junk\n               directory.\n\n   git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip >  \ngit-1.4.0.tar.gz\n               Create a compressed tarball for v1.4.0 release.\n\n   git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip  \n >git-1.4.0.tar.gz\n               Create a compressed tarball for v1.4.0 release, but  \nwithout a\n               global extended pax header.\n\n   git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ >  \ngit-1.4.0-docs.zip\n               Put everything in the current head's Documentation/  \ndirectory\n               into git-1.4.0-docs.zip, with the prefix git-docs/.\n\nIMHO, git export is probably a better name for the command. git- \narchive sounds like backup everything associated with git.\n\n__Luke\n"},{"id":"65493","messageId":"478D95D8.5040806@theory.org","threadId":"11638","inReplyTo":"478D82FA.2030404@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Neil Macneale","fromEmail":"mac4-git@theory.org","sentAt":"2008-01-16T05:27:52Z","receivedAt":"2008-01-16T05:27:52Z","isPatch":false,"sender":{"key":"mac4-git@theory.org","avatar":null},"body":"Mike wrote:\n> ....  And as for permissions and ownership, rsync takes care of that.\nPerhaps \"rsync --exclude *.git\"?\n\nIt seems to me that you are asking git to be your deployment software, \nwhich is a bad fit.\n\nCheers,\nNeil\n"},{"id":"65495","messageId":"478D9D60.9070807@talkingspider.com","threadId":"11638","inReplyTo":"478D8062.3090506@gmail.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T06:00:00Z","receivedAt":"2008-01-16T06:00:00Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nDan McGee wrote:\n> On 01/15/2008 09:27 PM, Mike wrote:\n>> How do I make the repository dir live somewhere else, the hell away from\n>> my code? Thanks\n> \n> mv .git <location to move to>\n> ln -s <location moved to> .git\n> \n> Did you try this before you sent your email?\n\nNo, good idea. But it didn't work.  When I git commit -a, I get \"fatal: \nNot a git repository\"\n\n(And also even if that worked, it wouldn't work on an NTFS partiton, \nright...)\n"},{"id":"65497","messageId":"478D9F16.2000801@onehammer.com","threadId":"11638","inReplyTo":"478D9D60.9070807@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike Krier","fromEmail":"mikek@onehammer.com","sentAt":"2008-01-16T06:07:18Z","receivedAt":"2008-01-16T06:07:18Z","isPatch":false,"sender":{"key":"mikek@onehammer.com","avatar":null},"body":"\n\nMike wrote:\n> \n> No, good idea. But it didn't work.  When I git commit -a, I get \"fatal: \n> Not a git repository\"\n> \n> (And also even if that worked, it wouldn't work on an NTFS partiton, \n> right...)\n\nWait, it worked!  thanks!\n\nHmm although some of our code is (necessarily) on an NTFS partition... hmm..\n"},{"id":"65496","messageId":"478D9FA7.3090602@talkingspider.com","threadId":"11638","inReplyTo":"478D9D60.9070807@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T06:09:43Z","receivedAt":"2008-01-16T06:09:43Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nMike wrote:\n> \n> No, good idea. But it didn't work.  When I git commit -a, I get \"fatal: \n> Not a git repository\"\n> \n> (And also even if that worked, it wouldn't work on an NTFS partiton, \n> right...)\n\nWait, it worked!  thanks!\n\nHmm although some of our code is (necessarily) on an NTFS partition... hmm..\n"},{"id":"65506","messageId":"vpq4pdeum3v.fsf@bauges.imag.fr","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-01-16T09:59:48Z","receivedAt":"2008-01-16T09:59:48Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Mike <fromlists@talkingspider.com> writes:\n\n> I'm learning git and I'm really annoyed that the .git directory lives\n> in the same directory as my code.  I don't want it there for three\n> reasons:\n\nThe idea was discussed here, mostly under the name \"gitlink\". I'd like\nit for another reason :\n\n* Have my tree on a fast, unrelialbe local disk, and have my .git on a\n  slower, but safe and backed-up NFS partition.\n\nBut up to now, AFAIK, no one (including myself ;-) ) stepped-in to\nimplement it.\n\n-- \nMatthieu\n"},{"id":"65507","messageId":"alpine.LSU.1.00.0801161035380.17650@racer.site","threadId":"11638","inReplyTo":"vpq4pdeum3v.fsf@bauges.imag.fr","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-16T10:36:34Z","receivedAt":"2008-01-16T10:36:34Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jan 2008, Matthieu Moy wrote:\n\n> Mike <fromlists@talkingspider.com> writes:\n> \n> > I'm learning git and I'm really annoyed that the .git directory lives \n> > in the same directory as my code.  I don't want it there for three \n> > reasons:\n> \n> The idea was discussed here, mostly under the name \"gitlink\".\n\nIt goes by \"git worktree\"; has nothing to do with gitlink (which has \nsomething to do with submodules).\n\n> But up to now, AFAIK, no one (including myself ;-) ) stepped-in to \n> implement it.\n\nIt has been implemented, and it works.\n\nCiao,\nDscho\n"},{"id":"65508","messageId":"alpine.LSU.1.00.0801161036510.17650@racer.site","threadId":"11638","inReplyTo":"478D8717.50100@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-16T10:37:51Z","receivedAt":"2008-01-16T10:37:51Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 15 Jan 2008, Mike wrote:\n\n> Daniel Barkalow wrote:\n> > On Tue, 15 Jan 2008, Mike wrote:\n> >\n> > Generate your tarballs with \"git archive\", which will also make sure \n> > that you don't accidentally include anything else that's not \n> > committed. Likewise for sending to the live site, probably.\n> \n> Thanks please see my response to David about why this isn't good.\n\nSee Luke Lu's answer to your response about why you're wrong.  It's even \nin the man page of git-archive.\n\nHth,\nDscho\n"},{"id":"65515","messageId":"18317.60797.644829.539598@lisa.zopyra.com","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801161035380.17650@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2008-01-16T11:41:49Z","receivedAt":"2008-01-16T11:41:49Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Wednesday, January 16, 2008 at 10:36:34 (+0000) Johannes Schindelin writes:\n>Hi,\n>\n>On Wed, 16 Jan 2008, Matthieu Moy wrote:\n>\n>> Mike <fromlists@talkingspider.com> writes:\n>> \n>> > I'm learning git and I'm really annoyed that the .git directory lives \n>> > in the same directory as my code.  I don't want it there for three \n>> > reasons:\n>> \n>> The idea was discussed here, mostly under the name \"gitlink\".\n>\n>It goes by \"git worktree\"; has nothing to do with gitlink (which has \n>something to do with submodules).\n\nI think you mean to say there is a variable 'worktree' variable\navailable via the config variable 'core.worktree' or environment\nvariable GIT_WORK_TREE, or command-line option --work-tree that should\ndo the trick (no 'git worktree' command exists as far as I can see):\n\n% man git-config\n[...]\n       core.worktree\n           Set the path to the working tree. The value will not be used in\n           combination with repositories found automatically in a .git\n           directory (i.e. $GIT_DIR is not set). This can be overriden by the\n           GIT_WORK_TREE environment variable and the --work-tree command line\n           option.\n[...]\n\n% man git\n[...]\n       --work-tree=<path>\n           Set the path to the working tree. The value will not be used in\n           combination with repositories found automatically in a .git\n           directory (i.e. $GIT_DIR is not set). This can also be controlled\n           by setting the GIT_WORK_TREE environment variable and the\n           core.worktree configuration variable.\n[...]\n\n\nBill\n"},{"id":"65516","messageId":"vpqd4s2rng9.fsf@bauges.imag.fr","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801161035380.17650@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-01-16T11:59:02Z","receivedAt":"2008-01-16T11:59:02Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Hi,\n>\n> On Wed, 16 Jan 2008, Matthieu Moy wrote:\n>\n>> Mike <fromlists@talkingspider.com> writes:\n>> \n>> > I'm learning git and I'm really annoyed that the .git directory lives \n>> > in the same directory as my code.  I don't want it there for three \n>> > reasons:\n>> \n>> The idea was discussed here, mostly under the name \"gitlink\".\n>\n> It goes by \"git worktree\";\n\nAny pointer to some doc? My git doesn't have a \"worktree\" command.\n\n> has nothing to do with gitlink (which has something to do with\n> submodules).\n\nWe may not be talking about the same gitlink then.\n\nThe one I'm refering to is \"Lightweight Checkout\nOtherwise known as the .gitlink idea.\" on\nhttp://git.or.cz/gitwiki/SoC2007Ideas for example.\n\n-- \nMatthieu\n"},{"id":"65517","messageId":"alpine.LSU.1.00.0801161211010.17650@racer.site","threadId":"11638","inReplyTo":"vpqd4s2rng9.fsf@bauges.imag.fr","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-16T12:12:07Z","receivedAt":"2008-01-16T12:12:07Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jan 2008, Matthieu Moy wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > On Wed, 16 Jan 2008, Matthieu Moy wrote:\n> >\n> >> Mike <fromlists@talkingspider.com> writes:\n> >> \n> >> > I'm learning git and I'm really annoyed that the .git directory \n> >> > lives in the same directory as my code.  I don't want it there for \n> >> > three reasons:\n> >> \n> >> The idea was discussed here, mostly under the name \"gitlink\".\n> >\n> > It goes by \"git worktree\";\n> \n> Any pointer to some doc? My git doesn't have a \"worktree\" command.\n\nI was not talking about a command.  I prepended \"git\" only to stress that \nthis worktree is not any worktree, but integrated into git.  I believe \nBill has already given all necessary pointers.\n\n> > has nothing to do with gitlink (which has something to do with \n> > submodules).\n> \n> We may not be talking about the same gitlink then.\n\nIndeed.\n\nCiao,\nDscho\n"},{"id":"65519","messageId":"vpq4pderm7k.fsf@bauges.imag.fr","threadId":"11638","inReplyTo":"18317.60797.644829.539598@lisa.zopyra.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2008-01-16T12:25:51Z","receivedAt":"2008-01-16T12:25:51Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> On Wednesday, January 16, 2008 at 10:36:34 (+0000) Johannes Schindelin writes:\n>>Hi,\n>>\n>>On Wed, 16 Jan 2008, Matthieu Moy wrote:\n>>\n>>> Mike <fromlists@talkingspider.com> writes:\n>>> \n>>> > I'm learning git and I'm really annoyed that the .git directory lives \n>>> > in the same directory as my code.  I don't want it there for three \n>>> > reasons:\n>>> \n>>> The idea was discussed here, mostly under the name \"gitlink\".\n>>\n>>It goes by \"git worktree\"; has nothing to do with gitlink (which has \n>>something to do with submodules).\n>\n> I think you mean to say there is a variable 'worktree' variable\n> available via the config variable 'core.worktree' or environment\n> variable GIT_WORK_TREE, or command-line option --work-tree that should\n> do the trick (no 'git worktree' command exists as far as I can see):\n\nYes, so you can use\n\n$ git --work-tree . --git-dir /some/other/place <some-command>\n\nBut it's far from the user-friendlyness of a real lightweight\ncheckout: you need to provide the --work-tree and --git-dir options\neach time you run git. And making an alias or using the environment\nvariables are not really an option if you have more than one\nrepository or working tree to deal with.\n\n-- \nMatthieu\n"},{"id":"65520","messageId":"alpine.LSU.1.00.0801161244390.17650@racer.site","threadId":"11638","inReplyTo":"vpq4pderm7k.fsf@bauges.imag.fr","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-16T12:45:52Z","receivedAt":"2008-01-16T12:45:52Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jan 2008, Matthieu Moy wrote:\n\n> Bill Lear <rael@zopyra.com> writes:\n> \n> > On Wednesday, January 16, 2008 at 10:36:34 (+0000) Johannes Schindelin writes:\n> >>Hi,\n> >>\n> >>On Wed, 16 Jan 2008, Matthieu Moy wrote:\n> >>\n> >>> Mike <fromlists@talkingspider.com> writes:\n> >>> \n> >>> > I'm learning git and I'm really annoyed that the .git directory lives \n> >>> > in the same directory as my code.  I don't want it there for three \n> >>> > reasons:\n> >>> \n> >>> The idea was discussed here, mostly under the name \"gitlink\".\n> >>\n> >>It goes by \"git worktree\"; has nothing to do with gitlink (which has \n> >>something to do with submodules).\n> >\n> > I think you mean to say there is a variable 'worktree' variable\n> > available via the config variable 'core.worktree' or environment\n> > variable GIT_WORK_TREE, or command-line option --work-tree that should\n> > do the trick (no 'git worktree' command exists as far as I can see):\n> \n> Yes, so you can use\n> \n> $ git --work-tree . --git-dir /some/other/place <some-command>\n> \n> But it's far from the user-friendlyness of a real lightweight checkout: \n> you need to provide the --work-tree and --git-dir options each time you \n> run git. And making an alias or using the environment variables are not \n> really an option if you have more than one repository or working tree to \n> deal with.\n\nWell, the OP said he did not want _any_ file in the worktree.  So there's \nno way around specifying by hand everytime where the git directory should \nbe.\n\nI'm not saying I find the OP's restrictions sensible, but that's what he \nsaid.\n\nCiao,\nDscho\n"},{"id":"65523","messageId":"m3bq7lncak.fsf@roke.D-201","threadId":"11638","inReplyTo":"478D79BD.7060006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2008-01-16T13:13:47Z","receivedAt":"2008-01-16T13:13:47Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Mike <fromlists@talkingspider.com> writes:\n\n> I'm learning git and I'm really annoyed that the .git directory lives\n> in the same directory as my code.  I don't want it there for three\n> reasons:\n> \n> 1. My code lives on a development web server docroot, and I don't want\n> the .git repository to end up getting published to the live site by\n> accident. (I would imagine this would be a common need.)\n\nUse git-archive (or, in older releases, git-tar-tree) and perhaps\npost-update / post-recieve hook to publish latest version.\n\nI think best layout would be: \n (1) your private copy (clone) of repository, with working directory\n (2) bare (without working directory) publishing repository,\n     with post-update hook\n (3) published last version of your files\n\nYou can check 'todo' branch of git.git repository for scripts which\nJunio uses to automatically update git HTML documentation at\nkernel.org\n \n> 2. If I tar/gz my code and deliver it to a client, I don't want the\n> .git dir slipping into the tarball, allowing my client to be able to\n> peruse the history of what we did and when.\n\nUse git-archive / git-tar-tree to tar.gz or zip code to send to client.\nThis has the advantage of not packing generated code, backup files,\netc., not only .git. Besides there is --exclude option to tar ;-)\n \n(For RPM based distributions git-archive is usually in git-core;\nI don't know what package you have to install on Debian based distro).\n\n> 3. The .git respository will get big, especially with binary files in\n> it, and I want it someplace with a lot of disk space. And I don't want\n> it to get tarred up when we migrate the site to a different\n> server. (And tar isn't aware of hard links is it? wonderful.)\n> \n> How do I make the repository dir live somewhere else, the hell away\n> from my code? Thanks\n\nIf you are inside repo, configuration variable core.worktree,\nenvironmental variable GIT_WORK_DIR, or '--work-tree' command line\noption (git --work-tree=/path/to/working/dir <cmd>) can be used to\npoint to working tree.\n\nIf you are in working area, environmental variable GIT_DIR, or\n'--git-dir' command line option can be used to point to the\nrepository. You can also symlink .git in working directory.\nThere was an idea of '.gitlink' file, similar to CVS/Root file\nin CVS, or core.gitdir configuration variable which points to\nbase GIT_DIR in unionfs / shadow like way, but neither got\nimplemented. You are welcome to it... of course after release :-)\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"65524","messageId":"36ca99e90801160521v4851bdf8n72e69d69f6344013@mail.gmail.com","threadId":"11638","inReplyTo":"alpine.LNX.1.00.0801152305050.13593@iabervon.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Bert Wesarg","fromEmail":"bert.wesarg@googlemail.com","sentAt":"2008-01-16T13:21:45Z","receivedAt":"2008-01-16T13:21:45Z","isPatch":false,"sender":{"key":"bert.wesarg@googlemail.com","avatar":"https://avatars.githubusercontent.com/u/111934?v=4"},"body":"On Jan 16, 2008 5:13 AM, Daniel Barkalow <barkalow@iabervon.org> wrote:\n> On Tue, 15 Jan 2008, Mike wrote:\n>\n> > How do I make the repository dir live somewhere else, the hell away from my\n> > code? Thanks\n>\n> export GIT_DIR=/somewhere-else.git\n>\n> Note that this only really works if you've only got one repository;\n> there's no good way to have the repository information outside of the\n> working directory and still have which repository you're using depend on\n> which directory you're working in.\nThis project may solve this problem:\n\nhttp://swapoff.org/OnDir\n\nBert\n\n>\n>         -Daniel\n"},{"id":"65562","messageId":"478E3D7D.4000700@talkingspider.com","threadId":"11638","inReplyTo":"D017F6F6-D674-428B-936B-181BF20CF4B5@vicaya.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T17:23:09Z","receivedAt":"2008-01-16T17:23:09Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nLuke Lu wrote:\n> \n> On Jan 15, 2008, at 8:18 PM, Mike wrote:\n> \n>>\n>> David Symonds wrote:\n>>> On Jan 16, 2008 2:27 PM, Mike <fromlists@talkingspider.com> wrote:\n>>>> 2. If I tar/gz my code and deliver it to a client, I don't want the \n>>>> .git\n>>>> dir slipping into the tarball, allowing my client to be able to peruse\n>>>> the history of what we did and when.\n>>> Use git-archive.\n>>\n>> Thanks but this isn't sufficient. If we have one directory of our web \n>> root in a git repository, say docroot/php, and we tar up docroot, it \n>> will include php/.git.  We don't want that.  We would have to go out \n>> of our way to avoid the .git directory.  The point is, we don't want \n>> anything in docroot that shouldn't be made live.\n> \n> git-archive generates an archive file *without* the .git directory. From \n> git-archive(1):\n> \n>   git archive --format=tar --prefix=junk/ HEAD | (cd /var/tmp/ && tar xf -)\n>               Create a tar archive that contains the contents of the latest\n>               commit on the current branch, and extracts it in \n> /var/tmp/junk\n>               directory.\n> \n>   git archive --format=tar --prefix=git-1.4.0/ v1.4.0 | gzip > \n> git-1.4.0.tar.gz\n>               Create a compressed tarball for v1.4.0 release.\n> \n>   git archive --format=tar --prefix=git-1.4.0/ v1.4.0^{tree} | gzip \n>  >git-1.4.0.tar.gz\n>               Create a compressed tarball for v1.4.0 release, but without a\n>               global extended pax header.\n> \n>   git archive --format=zip --prefix=git-docs/ HEAD:Documentation/ > \n> git-1.4.0-docs.zip\n>               Put everything in the current head's Documentation/ directory\n>               into git-1.4.0-docs.zip, with the prefix git-docs/.\n> \n> IMHO, git export is probably a better name for the command. git-archive \n> sounds like backup everything associated with git.\n> \n> __Luke\n> -\n\nOK I don't think you read my response closely.  I wasn't going to \nrespond except I see Johannes missed the point too.\n\nI completely understand that git archive will not inlcude the .git dir. \nWhat you missed in my response is the case where someone tars up a \ndirectory above the .git directory. Not all of the content under doc \nroot is in a git archive.\n"},{"id":"65563","messageId":"478E3D8E.1090300@talkingspider.com","threadId":"11638","inReplyTo":"478D95D8.5040806@theory.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T17:23:26Z","receivedAt":"2008-01-16T17:23:26Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nNeil Macneale wrote:\n > Mike wrote:\n >> ....  And as for permissions and ownership, rsync takes care of that.\n > Perhaps \"rsync --exclude *.git\"?\n >\n > It seems to me that you are asking git to be your deployment software,\n > which is a bad fit.\n\nI'm asking git to get out of my deployment!\n"},{"id":"65564","messageId":"478E3F5B.5040000@talkingspider.com","threadId":"11638","inReplyTo":"BAYC1-PASMTP143D18D25EC9A59ABD42D7AE400@CEZ.ICE","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-16T17:31:07Z","receivedAt":"2008-01-16T17:31:07Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\nSean wrote:\n> On Tue, 15 Jan 2008 23:07:22 -0500\n> Mike <fromlists@talkingspider.com> wrote:\n> \n> \n>>> git archive --help\n>>>\n>> I got:\n>>\n>> $ git archive --help\n>> No manual entry for git-archive\n>>\n>> Did I install it wrong?  I have CentOS 5, and I did:\n>>\n>> su\n>> yum install git\n>>\n> \n> Yes, on Centos you probably need \"yum install git-core\"  which installs all\n> the assorted pieces and dependencies of Git.\n> \n\nThanks but didn't work-\n\n# yum install git-core\nLoading \"installonlyn\" plugin\nSetting up Install Process\nSetting up repositories\nrpmforge                  100% |=========================| 1.1 kB    00:00\nbase                      100% |=========================| 1.1 kB    00:00\nupdates                   100% |=========================|  951 B    00:00\naddons                    100% |=========================|  951 B    00:00\nextras                    100% |=========================| 1.1 kB    00:00\nReading repository metadata in from local files\nParsing package install arguments\nNothing to do\n\nAlso if this helps, here's what I have for git:\n\n$ rpm -qa | grep -i git\ngit-1.5.2.1-1.el5.rf\nxorg-x11-drv-digitaledge-1.1.0-1.1\nperl-Git-1.5.2.1-1.el5.rf\n"},{"id":"65565","messageId":"7vd4s1sm7y.fsf@gitster.siamese.dyndns.org","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801161244390.17650@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-16T17:40:17Z","receivedAt":"2008-01-16T17:40:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Yes, so you can use\n>> \n>> $ git --work-tree . --git-dir /some/other/place <some-command>\n>> \n>> But it's far from the user-friendlyness of a real lightweight checkout: \n>> you need to provide the --work-tree and --git-dir options each time you \n>> run git. And making an alias or using the environment variables are not \n>> really an option if you have more than one repository or working tree to \n>> deal with.\n>\n> Well, the OP said he did not want _any_ file in the worktree.  So there's \n> no way around specifying by hand everytime where the git directory should \n> be.\n\nExport GIT_DIR and GIT_WORKTREE and you are free to go, right?\n"},{"id":"65566","messageId":"alpine.LSU.1.00.0801161751000.17650@racer.site","threadId":"11638","inReplyTo":"478E3D8E.1090300@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-16T17:51:22Z","receivedAt":"2008-01-16T17:51:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jan 2008, Mike wrote:\n\n> Neil Macneale wrote:\n> > Mike wrote:\n> >> ....  And as for permissions and ownership, rsync takes care of that.\n> > Perhaps \"rsync --exclude *.git\"?\n> >\n> > It seems to me that you are asking git to be your deployment software,\n> > which is a bad fit.\n> \n> I'm asking git to get out of my deployment!\n\nBut that's easy: rm -rf /usr/bin/git* .git/ ;-)\n\nHth,\nDscho\n"},{"id":"65567","messageId":"alpine.LSU.1.00.0801161752360.17650@racer.site","threadId":"11638","inReplyTo":"7vd4s1sm7y.fsf@gitster.siamese.dyndns.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-16T17:52:53Z","receivedAt":"2008-01-16T17:52:53Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 16 Jan 2008, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> >> Yes, so you can use\n> >> \n> >> $ git --work-tree . --git-dir /some/other/place <some-command>\n> >> \n> >> But it's far from the user-friendlyness of a real lightweight \n> >> checkout: you need to provide the --work-tree and --git-dir options \n> >> each time you run git. And making an alias or using the environment \n> >> variables are not really an option if you have more than one \n> >> repository or working tree to deal with.\n> >\n> > Well, the OP said he did not want _any_ file in the worktree.  So \n> > there's no way around specifying by hand everytime where the git \n> > directory should be.\n> \n> Export GIT_DIR and GIT_WORKTREE and you are free to go, right?\n\nYep.\n\nCiao,\nDscho\n"},{"id":"65572","messageId":"alpine.LFD.1.00.0801161000310.2806@woody.linux-foundation.org","threadId":"11638","inReplyTo":"478E3D8E.1090300@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-16T18:15:12Z","receivedAt":"2008-01-16T18:15:12Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 16 Jan 2008, Mike wrote:\n>\n> Neil Macneale wrote:\n> >\n> > It seems to me that you are asking git to be your deployment software,\n> > which is a bad fit.\n> \n> I'm asking git to get out of my deployment!\n\nI think you mis-understood.\n\nThe normal way of handling this is to NOT DO DEVELOPMENT IN YOUR \nDEPLOYMENT TREE!\n\nIt's almost always a bad idea to develop in the tree that is also where \nyou \"export\" things, and if you find git annoying in this respect, ask \nyourself why pretty much *every*single*scm*out*there* makes their \ninfrastructure even more noticeable (eg CVS subdirectories in every single \ndirectory etc)\n\nSo while you can do various tricks (symlinking \".git\", using GIT_DIR, etc \netc) to get the .git contents out of your worktree, the thing is, the \ncorrect thing to do is almost always to simply re-think the whole problem, \nand come at it the other way: rather than getting .git out of your \ndevelopment tree, you should consider getting your development tree out of \nyour deployment area!\n\nLet me do a few examples of why this is a good idea:\n\n - the whole point of development trees and SCM's (and that's *especially* \n   true with git) is how you can try things out, go backwards in time, and \n   generally just do *development*.\n\n   If you do that in what is your public deployment area, you're already \n   very limited. Not only may you not want to make that .git directory \n   accessible to others (while you *do* obviously want to make the \n   deployment itself), you also end up exposing things like your \n   management scripts and source code along with \"generated files\" etc \n   that are the things you actually want to deploy.\n\n   Yes, it's certainly quite possible that you simply don't have any \n   management scripts etc, and that you don't generate any files, and you \n   simply want to just deploy the exact files that you also want to track. \n   But that really is a fairly unusual thing to do.\n\n - with git in particular, you lose a lot of the capabilities if you are \n   forcing yourself to have \"deployment == development tree\". Things like \n   switching branches for managing different versions suddenly are \n   painful, because you're artificially forcing a 1:1 relationship between \n   \"development\" and \"deployment\".\n\n - Most sane people want to deploy and test separately. In particular, you \n   want to test *before* you deploy. People make mistakes, they don't want \n   to show them. Or there are consistency requirements, and/or you simply \n   want to deploy to multiple sites simultaneously. All of which really \n   re-inforces the \"develop separately\" mentality, where the actual \n   deployment is then a separate \"now I'm ready, let's push out the \n   result\".\n\nNow, maybe none of these things are issues at all for you. Good for you. \nBut hopefully this explains why most people don't have your issues, and \nwhy people try to tell you that \"deployment software\" is a separate thing \nfrom \"source control management\", and you often want both, and _want_ to \nkeep them separate.\n\n\t\tLinus\n"},{"id":"65573","messageId":"alpine.LFD.1.00.0801161019250.2806@woody.linux-foundation.org","threadId":"11638","inReplyTo":"alpine.LFD.1.00.0801161000310.2806@woody.linux-foundation.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-16T18:25:20Z","receivedAt":"2008-01-16T18:25:20Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 16 Jan 2008, Linus Torvalds wrote:\n> \n>    Yes, it's certainly quite possible that you simply don't have any \n>    management scripts etc, and that you don't generate any files, and you \n>    simply want to just deploy the exact files that you also want to track. \n>    But that really is a fairly unusual thing to do.\n\nExample management scripts: let's say that you have a logo that shows up \nin multiple different sizes. You can just have it as <n> number of \ndifferent files that you check in and update separately, or you can have \nit as *one* scalable master file, and then the deployment script will \ncreate all the generated files and put them in the deployment area.\n\nSo the common issue with SCM's is that you want to share two totally \ndifferent things:\n\n - the actual \"source\" (which obviously doesn't have to be source code per \n   se), which is the thing you want to have for yourself and people you \n   work with, and which you want the history of.\n\n - the \"output\" for external entities, which may often contain a lot of \n   the \"source\" verbatim, but quite often doesn't contain it all (some of \n   the stuff you need to manage things may be rather private and purely \n   for *your* management info), and almost invariably contains some \n   post-processing.\n\nSome people don't split this up, and they tend to make horrible horrible \nmistakes, like checking in the *results* of the post-processing too (ie \nbinary result blobs that can be regenerated from the other files), because \nthey don't make a clear separation between the parts they do development \non, and the end result.\n\n\t\t\tLinus\n"},{"id":"65587","messageId":"7v8x2pr2w4.fsf@gitster.siamese.dyndns.org","threadId":"11638","inReplyTo":"alpine.LFD.1.00.0801161000310.2806@woody.linux-foundation.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-16T19:23:07Z","receivedAt":"2008-01-16T19:23:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Linus Torvalds <torvalds@linux-foundation.org> writes:\n\n> Let me do a few examples of why this is a good idea:\n>\n>  - the whole point of development trees and SCM's (and that's *especially* \n>    true with git) is how you can try things out, go backwards in time, and \n>    generally just do *development*.\n>\n>    If you do that in what is your public deployment area, you're already \n>    very limited. Not only may you not want to make that .git directory \n>    accessible to others (while you *do* obviously want to make the \n>    deployment itself), you also end up exposing things like your \n>    management scripts and source code along with \"generated files\" etc \n>    that are the things you actually want to deploy.\n>\n>    Yes, it's certainly quite possible that you simply don't have any \n>    management scripts etc, and that you don't generate any files, and you \n>    simply want to just deploy the exact files that you also want to track. \n\nEven without any management script, you cannot do any _development_\nin such a tree.  By definition, mucking with the files in the\ndeployment area means all of your changes are immediately visible by\nthe clients.\n\nOne reason (admittedly misguided) people mentioned why they want\nto do this is because they want to be able to \"git-add\" files\ngenerated on the deployed server by client actions (think of a\nWiki that drops new contents in an area writable by the\nwebserver).  If your deployment area is _not_ managed by git,\nthey instead need to write a Makefile target in their\ndevelopment area that takes new/modified files back to the\ndevelopment tree and \"git-add\" those copies.\n\nThe right way to manage these client-generated contents would of\ncourse be to commit them to a branch separate from the sources\nyou develop (otherwise your history will be a mixed mess between\nthe true development and client content changes), so the\nargument is very weak and is not a good justification for\nwanting to have deployment and development tree as one.\n\nBut I can well imagine that it is a tempting way to work for\npeople who have not thought about the reason why history\nmatters, especially for the ones who still suffer from CVS\nbraindamage that makes separate branches inpractical.\n"},{"id":"65614","messageId":"20080116223333.GB17142@blorf.net","threadId":"11638","inReplyTo":"alpine.LNX.1.00.0801152305050.13593@iabervon.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Wayne Davison","fromEmail":"wayne@opencoder.net","sentAt":"2008-01-16T22:33:33Z","receivedAt":"2008-01-16T22:33:33Z","isPatch":false,"sender":{"key":"wayne@opencoder.net","avatar":"https://gravatar.com/avatar/d55d81825271b1bfe65e57e4e04297d4119aa03c6a1c71d2ff2812b9b4be9f45?d=mp&s=160"},"body":"On Tue, Jan 15, 2008 at 11:13:58PM -0500, Daniel Barkalow wrote:\n> export GIT_DIR=/somewhere-else.git\n> \n> Note that this only really works if you've only got one repository; \n> there's no good way to have the repository information outside of the \n> working directory and still have which repository you're using depend on \n> which directory you're working in.\n\nIf you use zsh as your shell, put this chpwd function in .zprofile or\n.zshrc:\n\nchpwd() {\n    local gitbasedir=/var/local/git\n    local subdir=$gitbasedir$PWD\n    while [[ ! -d $subdir ]]; do\n\tsubdir=${subdir:h}\n    done\n    if [[ -d $subdir/.git ]]; then\n\texport GIT_DIR=$subdir/.git\n\texport GIT_WORK_TREE=${subdir/$gitbasedir/}\n    else\n\tunset GIT_DIR GIT_WORK_TREE\n    fi\n}\n\nThen, for each /path/.git dir, move it to /var/local/git/path/.git\n(creating any needed parent dirs).  On every change of directory in\nthe shell, the variables GIT_DIR and GIT_WORK_TREE will be either\nupdated or cleared.  If you ever move a work-tree dir, you'll need\nto remember to move the .git dir in the /var/local/git hierarchy.\n\n..wayne..\n"},{"id":"65656","messageId":"20080117005954.GM18022@lavos.net","threadId":"11638","inReplyTo":"m3bq7lncak.fsf@roke.D-201","subject":"Re: I don't want the .git directory next to my code.","fromName":"Brian Downing","fromEmail":"bdowning@lavos.net","sentAt":"2008-01-17T00:59:54Z","receivedAt":"2008-01-17T00:59:54Z","isPatch":false,"sender":{"key":"bdowning@lavos.net","avatar":"https://avatars.githubusercontent.com/u/366426?v=4"},"body":"On Wed, Jan 16, 2008 at 05:13:47AM -0800, Jakub Narebski wrote:\n> > 2. If I tar/gz my code and deliver it to a client, I don't want the\n> > .git dir slipping into the tarball, allowing my client to be able to\n> > peruse the history of what we did and when.\n> \n> Use git-archive / git-tar-tree to tar.gz or zip code to send to client.\n> This has the advantage of not packing generated code, backup files,\n> etc., not only .git. Besides there is --exclude option to tar ;-)\n\nI realize that this is not directly what's being talked about here, but\none advantage to using \"full Git\" for deployment rather than something\nlike \"git archive\" is that Git has already implemented an\noptimized-to-within-an-inch-of-its-life incremental filesystem updater -\nnamely, \"git checkout-index\".  If you always deploy with \"git archive\",\nit could take a very long time to update a large web site even if only a\ntiny change has taken place.\n\nYes, you could use rsync or some other tool, but Git already has the\ntools available, so why not take advantage of them?\n\n(Now, maybe some custom scripting to call plumbing like \"git\ncheckout-index\" would be more appropriate that using a \"normal\" working\ndirectory, but I think the advantages of using Git's optimized WD update\ntools here should be obvious for large sites...)\n\n-bcd\n"},{"id":"65662","messageId":"86sl0xfd4e.fsf@blue.stonehenge.com","threadId":"11638","inReplyTo":"20080117005954.GM18022@lavos.net","subject":"Re: I don't want the .git directory next to my code.","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2008-01-17T01:35:13Z","receivedAt":"2008-01-17T01:35:13Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Brian\" == Brian Downing <bdowning@lavos.net> writes:\n\nBrian> Yes, you could use rsync or some other tool, but Git already has the\nBrian> tools available, so why not take advantage of them?\n\nIt's very likely that rsync will be faster/better/cheaper/more-flexible\nthan git.  \"Yes, you could use git, but rsync already does the job\nbetter, so why not take advantage of it?\"  Back at ya.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"65664","messageId":"478EB29C.9080908@vilain.net","threadId":"11638","inReplyTo":"478D85A9.6050807@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2008-01-17T01:42:52Z","receivedAt":"2008-01-17T01:42:52Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Mike wrote:\n> Thanks but this isn't sufficient. If we have one directory of our web \n> root in a git repository, say docroot/php, and we tar up docroot, it \n> will include php/.git.  We don't want that.  We would have to go out of \n> our way to avoid the .git directory.  The point is, we don't want \n> anything in docroot that shouldn't be made live.\n\nIt sounds like you want a tool more like Capistrano, which can use git,\nrather than just pushing files around with git.\n\nSam.\n"},{"id":"65669","messageId":"46dff0320801161800y9f5bf0cvb1804a57c41c3f4c@mail.gmail.com","threadId":"11638","inReplyTo":"alpine.LFD.1.00.0801161000310.2806@woody.linux-foundation.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Ping Yin","fromEmail":"pkufranky@gmail.com","sentAt":"2008-01-17T02:00:09Z","receivedAt":"2008-01-17T02:00:09Z","isPatch":false,"sender":{"key":"pkufranky@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5346?v=4"},"body":"On Jan 17, 2008 2:15 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n>\n>\n>\n\n>\n>  - Most sane people want to deploy and test separately. In particular, you\n>   want to test *before* you deploy. People make mistakes, they don't want\n>   to show them. Or there are consistency requirements, and/or you simply\n>   want to deploy to multiple sites simultaneously. All of which really\n>   re-inforces the \"develop separately\" mentality, where the actual\n>   deployment is then a separate \"now I'm ready, let's push out the\n>   result\".\n>\nUsing git to manage deployment environment and even as deployment\ntools is not always a bad idea.\n\n1. In case where development and deployment environment are almost the\nsame, such as html files, js files, binding the two environments as\none is convenient.\n\n2. Event In the case where the two environement are different very\nmuch, managing deployment environment in git sometimes still seems\ngood, since we can easily back to any earlier version or fix some\nurgent bug ASAP (surely for the non-generated files).\n\n3. Use 'git pull' as deploy command seems simple enough.\n\n>\n>                Linus\n>\n>\n>\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>\n\n\n\n-- \nPing Yin\n"},{"id":"65672","messageId":"alpine.LFD.1.00.0801161834380.2806@woody.linux-foundation.org","threadId":"11638","inReplyTo":"46dff0320801161800y9f5bf0cvb1804a57c41c3f4c@mail.gmail.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-17T02:38:28Z","receivedAt":"2008-01-17T02:38:28Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 17 Jan 2008, Ping Yin wrote:\n>\n> Using git to manage deployment environment and even as deployment\n> tools is not always a bad idea.\n\nI don't think it's alway sa bad idea, no. But it's a good idea only if you \nthen accept things like \".git\" subdirectories lying around in your \ndeployment area (or you accept the use of tricks like GIT_DIR).\n\n> 1. In case where development and deployment environment are almost the\n> same, such as html files, js files, binding the two environments as\n> one is convenient.\n> \n> 2. Event In the case where the two environement are different very\n> much, managing deployment environment in git sometimes still seems\n> good, since we can easily back to any earlier version or fix some\n> urgent bug ASAP (surely for the non-generated files).\n> \n> 3. Use 'git pull' as deploy command seems simple enough.\n\nHey, I do it for all my kernels (\"git pull\" + \"make\" is just simpler than \npushing tar-balls around), so I'm not entirely disagreeing. I *like* \nhaving the entire development environment around everywhere.\n\nBut it does seem like a lot of Mike's problems basically boil down to the \nfact that he doesn't really want to use it as a deployment tool.\n\n\t\tLinus\n"},{"id":"65676","messageId":"46a038f90801161859n2f7d8c33kb5d359fb25d07488@mail.gmail.com","threadId":"11638","inReplyTo":"86sl0xfd4e.fsf@blue.stonehenge.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2008-01-17T02:59:05Z","receivedAt":"2008-01-17T02:59:05Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Jan 17, 2008 2:35 PM, Randal L. Schwartz <merlyn@stonehenge.com> wrote:\n> >>>>> \"Brian\" == Brian Downing <bdowning@lavos.net> writes:\n>\n> Brian> Yes, you could use rsync or some other tool, but Git already has the\n> Brian> tools available, so why not take advantage of them?\n>\n> It's very likely that rsync will be faster/better/cheaper/more-flexible\n> than git.  \"Yes, you could use git, but rsync already does the job\n> better, so why not take advantage of it?\"  Back at ya.\n\nWe do web development, and use various deployment tools, usually git,\ngit+rsync or git + debian packages.\n\nI find the discussion of git-archive as a deployment tool a bit\nworrying - remember that untarring a newer version of the tarball on\ntop of the old version does not remove old files. In web applications\n(and I think the OP is talking about web development) often security\nbugs come from sloppy inclusion of files (such as sample AdoDB code).\nIf you deploy your \"security fix\" by unpacking a tarball, chances are\nyou'll wake up to a p0wned server.\n\ncheers,\n\n\nmartin\n"},{"id":"65688","messageId":"478EEAC4.2010006@talkingspider.com","threadId":"11638","inReplyTo":"alpine.LFD.1.00.0801161019250.2806@woody.linux-foundation.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-17T05:42:28Z","receivedAt":"2008-01-17T05:42:28Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nLinus Torvalds wrote:\n\n> Some people don't split this up, and they tend to make horrible horrible \n> mistakes, like checking in the *results* of the post-processing too (ie \n> binary result blobs that can be regenerated from the other files), because \n> they don't make a clear separation between the parts they do development \n> on, and the end result.\n\nHonestly, I think your mode of thinking is centered around compiled \nlanguages and linux app(/kernel) development.  The web app \ndevelopment/deployment model is very different.\n\nWith PHP, Python, and Ruby, the development is the deployment.  The \nsource is the output.  You can't develop web apps in those languages \nunless the source files you're working on are under the doc root of your \ndevelopment server.   \"the parts they do development on\" and \"the end \nresult\" *are* the same files.\n\nThe \"development server -> staging server -> live\nserver\" model has been around in common use for as long as web\napplications have. In fact, the term \"deployment\" falls apart here. \n From my web app developer perspective, the deployment is what lands on \nthe live server.  For your git perspective, the \"deployment\" may mean \nthe .../docroot/php directory for the development server (where our app \ncode lives).\n\nThere's a fundamental \"best practice\" of web development being violated \nhere- keep your docroots clean, only put stuff in them that should go \nlive (or should eventually go live when ready).  Other files should not \nlive under docroot.\n\nAmong the reasons for that is security.  If one of those .git dirs does \nslip out and go live, it's a *huge* *gaping* *security* *hole*.  You \ncould download the repository because those files don't have extensions, \nso the browser would just download them. I could write a spider that \ncrawls around the web appending /.git to urls.\n\nIf we end up having to write a special \"publisher\" app to move files \nfrom dev to live, then it will only be because of those damn .git \ndirectories.  More likely we'd add some exclusions into an rsync \nwrapper, I guess. And then still worry about tarring up the docroot (not \nall of which is gitted).  And then worry that some young developer on \nthe team might SCP a directory's contents and he didn't notice that .git \ndir because it doesn't show up under \"ls\" or the \"ll\" alias.\n\nMaybe git just isn't intended to be used for anything besides compiled\nlanguages like c?  Or maybe just not for web app development?\n\nFinally, to this statement:\n\n> It's almost always a bad idea to develop in the tree that is also where\n> you \"export\" things, and if you find git annoying in this respect, ask\n> yourself why pretty much *every*single*scm*out*there* makes their\n> infrastructure even more noticeable (eg CVS subdirectories in every \nsingle\n> directory etc)\n\nI don't think that pointing at other SCM's practices as the authority is \nthe stance you really want to take. I can direct you to a video of a \nspeech by a brilliant guy, in front of some googlers, where he explains \nthat the entire reason he started the git project is because of the \nproblems with \"*every*single*scm*out*there*\".\n\nMike\n"},{"id":"65689","messageId":"86myr5f1ki.fsf@blue.stonehenge.com","threadId":"11638","inReplyTo":"46a038f90801161859n2f7d8c33kb5d359fb25d07488@mail.gmail.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2008-01-17T05:44:45Z","receivedAt":"2008-01-17T05:44:45Z","isPatch":false,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Martin\" == Martin Langhoff <martin.langhoff@gmail.com> writes:\n\nMartin> I find the discussion of git-archive as a deployment tool a bit\nMartin> worrying - remember that untarring a newer version of the tarball on\nMartin> top of the old version does not remove old files.\n\n\"rsync --exclude [dangerous things} --delete --delete-excluded\" is your friend.\n\nThey added --delete--excluded at my request, by the way.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"65691","messageId":"478EF7DE.3090709@shannon.id.au","threadId":"11638","inReplyTo":"478EEAC4.2010006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Kris Shannon","fromEmail":"kris@shannon.id.au","sentAt":"2008-01-17T06:38:22Z","receivedAt":"2008-01-17T06:38:22Z","isPatch":false,"sender":{"key":"kris@shannon.id.au","avatar":"https://gravatar.com/avatar/13a7c0b3c50ffacf54f456e543023fd702898bb134165fa805f019930524151f?d=mp&s=160"},"body":"Mike wrote:\n> \n> \n> Linus Torvalds wrote:\n> \n>> Some people don't split this up, and they tend to make horrible \n>> horrible mistakes, like checking in the *results* of the \n>> post-processing too (ie binary result blobs that can be regenerated \n>> from the other files), because they don't make a clear separation \n>> between the parts they do development on, and the end result.\n> \n> Honestly, I think your mode of thinking is centered around compiled \n> languages and linux app(/kernel) development.  The web app \n> development/deployment model is very different.\n> \n> With PHP, Python, and Ruby, the development is the deployment.  The \n> source is the output.  You can't develop web apps in those languages \n> unless the source files you're working on are under the doc root of your \n> development server.   \"the parts they do development on\" and \"the end \n> result\" *are* the same files.\n\nNot for me.  I've always had my source separate from development docroot\neven before I was using proper SCM's.  I've written stuff in all three\nlanguages you mention where deployment to the docroot (development or not)\nwas more than a simple copy.\n"},{"id":"65701","messageId":"6D3239B9-FFE2-48AB-A127-E394D2FC8130@wincent.com","threadId":"11638","inReplyTo":"478EEAC4.2010006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2008-01-17T10:34:48Z","receivedAt":"2008-01-17T10:34:48Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 17/1/2008, a las 6:42, Mike escribió:\n\n> Linus Torvalds wrote:\n>\n>> Some people don't split this up, and they tend to make horrible  \n>> horrible mistakes, like checking in the *results* of the post- \n>> processing too (ie binary result blobs that can be regenerated from  \n>> the other files), because they don't make a clear separation  \n>> between the parts they do development on, and the end result.\n>\n> Honestly, I think your mode of thinking is centered around compiled  \n> languages and linux app(/kernel) development.  The web app  \n> development/deployment model is very different.\n>\n> With PHP, Python, and Ruby, the development is the deployment.  The  \n> source is the output.  You can't develop web apps in those languages  \n> unless the source files you're working on are under the doc root of  \n> your development server.   \"the parts they do development on\" and  \n> \"the end result\" *are* the same files.\n>\n> The \"development server -> staging server -> live\n> server\" model has been around in common use for as long as web\n> applications have. In fact, the term \"deployment\" falls apart here.  \n> From my web app developer perspective, the deployment is what lands  \n> on the live server.  For your git perspective, the \"deployment\" may  \n> mean the .../docroot/php directory for the development server (where  \n> our app code lives).\n\nI don't think so. Most people I speak with doing web app development  \ndevelop locally and deploy remotely.\n\n> There's a fundamental \"best practice\" of web development being  \n> violated here- keep your docroots clean, only put stuff in them that  \n> should go live (or should eventually go live when ready).  Other  \n> files should not live under docroot.\n\nAssuming you're using Apache, why don't you just add an .htaccess file  \nto your repo at the top level which instructs Apache to forbid all  \naccess to .git and its contents? If Apache is so broken that you can't  \ntrust Apache to forbid access in those circumstances, then you can't  \ntrust it to not allow access to arbitrary paths on your filesystem  \noutside of your doc root anyway.\n\nCheers,\nWincent\n"},{"id":"65725","messageId":"20080117151725.GC2816@coredump.intra.peff.net","threadId":"11638","inReplyTo":"478EEAC4.2010006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-17T15:17:25Z","receivedAt":"2008-01-17T15:17:25Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jan 17, 2008 at 12:42:28AM -0500, Mike wrote:\n\n> If we end up having to write a special \"publisher\" app to move files from \n> dev to live, then it will only be because of those damn .git directories.  \n> More likely we'd add some exclusions into an rsync wrapper, I guess. And \n> then still worry about tarring up the docroot (not all of which is \n> gitted).  And then worry that some young developer on the team might SCP a \n> directory's contents and he didn't notice that .git dir because it doesn't \n> show up under \"ls\" or the \"ll\" alias.\n\nWhat is it that you want? You're worried about .git directories. Fine.\nThere have been _many_ responses suggesting solutions, including:\n\n  - having a deployment step which does the right thing\n  - moving .git away, and using --git-dir or GIT_DIR to specify it\n    manually\n  - moving .git away, using core.worktree, and doing git operations from\n    the repo directory\n  - moving .git away, and having your shell automagically update GIT_DIR\n    based on your current directory\n  - moving .git away, wrapping 'git' with a script that sets GIT_DIR\n    according to some mapping (I think somebody mentioning just mapping\n    /path/to/tree to /var/git/path/to/tree or similar, but obviously you\n    could make a custom mapping in a hard-coded file).\n\nYou don't seem happy with any of those. But the fact remains that the\ngit repo has to be stored _somewhere_, and when you run git, there needs\nto be some mapping telling it which git repo matches your working\ndirectory. So how _do_ you want to specify that mapping? \n\n-Peff\n"},{"id":"65737","messageId":"alpine.LFD.1.00.0801170849070.14959@woody.linux-foundation.org","threadId":"11638","inReplyTo":"20080117151725.GC2816@coredump.intra.peff.net","subject":"Re: I don't want the .git directory next to my code.","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-17T17:36:47Z","receivedAt":"2008-01-17T17:36:47Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 17 Jan 2008, Jeff King wrote:\n> \n> You don't seem happy with any of those. But the fact remains that the\n> git repo has to be stored _somewhere_, and when you run git, there needs\n> to be some mapping telling it which git repo matches your working\n> directory. So how _do_ you want to specify that mapping? \n\nOk, here's the ugliest idea *ever*:\n\nWe could actually use POSIX extended attributes (or whatever \nsystem-specific version of it a particular filesystem supports) for people \nwho *really* don't want to pollute their file structure.\n\nI know, I know, it's horrible. It's one of those things that would \nactually be reqlly convenient (and probably even pretty easy to \nimplement), but is also going to be *really* subtle when it breaks.\n\nBut I bet some people would like it. I personally tend to hate extended \nattributes (they tend to have serious problems with anything that moves \nthings around or backs them up - especially across filesystem boundaries), \nbut there is no question that they can't be convenient to hide \ninformation.\n\nAnyway, here's a really stupid patch. It kind of works, but it has no way \nto turn this off.\n\nOn at least Linux, with this you can do something like\n\n\t.. start off with a git directory ..\n\tmv .git /external/git/location\n\tsetfattr -n user.git-dir -v /external/git/location .\n\nand now that \"user.git-dir\" thing acts as a kind of invisible \"symlink\" to \nthe external git directory.\n\nNot exactly heavily tested, and I don't know how portable the whole xattr \nthing is (ie I know OS X has file attributes, I just don't know if the \ninterface is at all similar).\n\nI don't like extended attributes myself, but this patch really is pretty \nsimple and perhaps useful.\n\n\t\t\tLinus\n\n---\n setup.c |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex adede16..97865f4 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -1,5 +1,6 @@\n #include \"cache.h\"\n #include \"dir.h\"\n+#include <attr/xattr.h>\n \n static int inside_git_dir = -1;\n static int inside_work_tree = -1;\n@@ -302,6 +303,9 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \t */\n \toffset = len = strlen(cwd);\n \tfor (;;) {\n+\t\tint attr_len;\n+\t\tstatic char git_dir[PATH_MAX];\n+\n \t\tif (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))\n \t\t\tbreak;\n \t\tif (is_git_directory(\".\")) {\n@@ -312,6 +316,14 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \t\t\tcheck_repository_format_gently(nongit_ok);\n \t\t\treturn NULL;\n \t\t}\n+\t\tattr_len = getxattr(\".\", \"user.git-dir\", git_dir, sizeof(git_dir)-1);\n+\t\tif (attr_len > 0) {\n+\t\t\tgit_dir[attr_len] = 0;\n+\t\t\tif (is_git_directory(git_dir)) {\n+\t\t\t\tsetenv(GIT_DIR_ENVIRONMENT, git_dir, 1);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n \t\tchdir(\"..\");\n \t\tdo {\n \t\t\tif (!offset) {\n"},{"id":"65739","messageId":"alpine.LSU.1.00.0801171748520.5731@racer.site","threadId":"11638","inReplyTo":"alpine.LFD.1.00.0801170849070.14959@woody.linux-foundation.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-17T17:49:26Z","receivedAt":"2008-01-17T17:49:26Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jan 2008, Linus Torvalds wrote:\n\n> Ok, here's the ugliest idea *ever*:\n\nOkay, you won.\n\n> diff --git a/setup.c b/setup.c\n> index adede16..97865f4 100644\n> --- a/setup.c\n> +++ b/setup.c\n> @@ -1,5 +1,6 @@\n>  #include \"cache.h\"\n>  #include \"dir.h\"\n> +#include <attr/xattr.h>\n>  \n>  static int inside_git_dir = -1;\n>  static int inside_work_tree = -1;\n> @@ -302,6 +303,9 @@ const char *setup_git_directory_gently(int *nongit_ok)\n>  \t */\n>  \toffset = len = strlen(cwd);\n>  \tfor (;;) {\n> +\t\tint attr_len;\n> +\t\tstatic char git_dir[PATH_MAX];\n> +\n>  \t\tif (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))\n>  \t\t\tbreak;\n>  \t\tif (is_git_directory(\".\")) {\n> @@ -312,6 +316,14 @@ const char *setup_git_directory_gently(int *nongit_ok)\n>  \t\t\tcheck_repository_format_gently(nongit_ok);\n>  \t\t\treturn NULL;\n>  \t\t}\n> +\t\tattr_len = getxattr(\".\", \"user.git-dir\", git_dir, sizeof(git_dir)-1);\n> +\t\tif (attr_len > 0) {\n> +\t\t\tgit_dir[attr_len] = 0;\n> +\t\t\tif (is_git_directory(git_dir)) {\n> +\t\t\t\tsetenv(GIT_DIR_ENVIRONMENT, git_dir, 1);\n> +\t\t\t\tbreak;\n\nWhat's this break all about?\n\n> +\t\t\t}\n> +\t\t}\n>  \t\tchdir(\"..\");\n>  \t\tdo {\n>  \t\t\tif (!offset) {\n\nCiao,\nDscho\n"},{"id":"65744","messageId":"alpine.LFD.1.00.0801170958550.14959@woody.linux-foundation.org","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801171748520.5731@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-01-17T18:02:50Z","receivedAt":"2008-01-17T18:02:50Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 17 Jan 2008, Johannes Schindelin wrote:\n>\n> > Ok, here's the ugliest idea *ever*:\n> \n> Okay, you won.\n\n\"I would like to thank the Academy for giving me this honor. I couldn't \n have done this without my parents, my teachers in high school, and the \n girl next-door..\"\n\n> > +\t\tattr_len = getxattr(\".\", \"user.git-dir\", git_dir, sizeof(git_dir)-1);\n> > +\t\tif (attr_len > 0) {\n> > +\t\t\tgit_dir[attr_len] = 0;\n> > +\t\t\tif (is_git_directory(git_dir)) {\n> > +\t\t\t\tsetenv(GIT_DIR_ENVIRONMENT, git_dir, 1);\n> > +\t\t\t\tbreak;\n> \n> What's this break all about?\n\nWithout the break, it will consider it a failure, and try to go up the \ndirectory structure (\"..\") to find the next thing.\n\nIn other words, that \"break\" is exactly the same break as the one just a \nfew lines earlier:\n\n                if (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))\n                        break;\n\nie if we found a good git directory, we want to use it.\n\n\t\tLinus\n"},{"id":"65746","messageId":"alpine.LSU.1.00.0801171809400.5731@racer.site","threadId":"11638","inReplyTo":"alpine.LFD.1.00.0801170958550.14959@woody.linux-foundation.org","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-17T18:10:31Z","receivedAt":"2008-01-17T18:10:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jan 2008, Linus Torvalds wrote:\n\n> On Thu, 17 Jan 2008, Johannes Schindelin wrote:\n> >\n> > > Ok, here's the ugliest idea *ever*:\n> > \n> > Okay, you won.\n> \n> \"I would like to thank the Academy for giving me this honor. I couldn't\n>  have done this without my parents, my teachers in high school, and the \n>  girl next-door..\"\n\nYou forgot the tears.\n\n> > > +\t\tattr_len = getxattr(\".\", \"user.git-dir\", git_dir, sizeof(git_dir)-1);\n> > > +\t\tif (attr_len > 0) {\n> > > +\t\t\tgit_dir[attr_len] = 0;\n> > > +\t\t\tif (is_git_directory(git_dir)) {\n> > > +\t\t\t\tsetenv(GIT_DIR_ENVIRONMENT, git_dir, 1);\n> > > +\t\t\t\tbreak;\n> > \n> > What's this break all about?\n> \n> Without the break, it will consider it a failure, and try to go up the \n> directory structure (\"..\") to find the next thing.\n\nAh, but of course.  For some reason I expected this code outside of the \nloop, but it _has_ to be inside.\n\nThanks for enlightening a poor schmock,\nDscho\n"},{"id":"65766","messageId":"478FA8B0.2000205@talkingspider.com","threadId":"11638","inReplyTo":"20080117151725.GC2816@coredump.intra.peff.net","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-17T19:12:48Z","receivedAt":"2008-01-17T19:12:48Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nJeff King wrote:\n>   - moving .git away, and using --git-dir or GIT_DIR to specify it\n>     manually\n\nActually, git-dir is sufficient for our needs, thanks.  I haven't been \nable to get my hands on man pages for git until this morning.  (If you \nlook near the top of this thread you see that I don't have the git man \npages because apparently CentOS (and probably RHEL too), doesn't include \nthem when you \"yum install git\").\n\nLinus posted a response about deployment and development being \nseparated, so I had to point out why that doesn't work for web apps in \ninterpreted languages.\n\nYou guys might want to complain to the CentOS (and/or RHEL) maintainers \nto have them put the man pages into the yum rpm. Er or whoever maintains \nthat (they maintain that rpm, right? I don't know).\n\nThanks, Jeff,\n\nmike\n"},{"id":"65768","messageId":"alpine.LSU.1.00.0801171918560.5731@racer.site","threadId":"11638","inReplyTo":"478FA8B0.2000205@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-17T19:20:25Z","receivedAt":"2008-01-17T19:20:25Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jan 2008, Mike wrote:\n\n> I haven't been able to get my hands on man pages for git until this \n> morning.\n\nGoogling for \"git man pages\" gives you \n\nhttp://www.kernel.org/pub/software/scm/git/docs/\n\nas first hit.  That should work even on a bare-bones CentOS.\n\nHth,\nDscho\n"},{"id":"65771","messageId":"478FB3E3.40307@talkingspider.com","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801171918560.5731@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-17T20:00:35Z","receivedAt":"2008-01-17T20:00:35Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nJohannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 17 Jan 2008, Mike wrote:\n> \n>> I haven't been able to get my hands on man pages for git until this \n>> morning.\n> \n> Googling for \"git man pages\" gives you \n> \n> http://www.kernel.org/pub/software/scm/git/docs/\n> \n> as first hit.  That should work even on a bare-bones CentOS.\n\nYea, I had googled for \"git manpages\". Which doesn't.\n\nmike\n"},{"id":"65772","messageId":"alpine.LSU.1.00.0801172007510.5731@racer.site","threadId":"11638","inReplyTo":"478FB3E3.40307@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-17T20:08:14Z","receivedAt":"2008-01-17T20:08:14Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jan 2008, Mike wrote:\n\n> Johannes Schindelin wrote:\n> \n> > On Thu, 17 Jan 2008, Mike wrote:\n> > \n> > > I haven't been able to get my hands on man pages for git until this \n> > > morning.\n> > \n> > Googling for \"git man pages\" gives you \n> > http://www.kernel.org/pub/software/scm/git/docs/\n> > as first hit.  That should work even on a bare-bones CentOS.\n> \n> Yea, I had googled for \"git manpages\". Which doesn't.\n\nIt does here.  Just checked.\n\nCiao,\nDscho\n"},{"id":"65778","messageId":"478FBF3D.8030604@talkingspider.com","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801172007510.5731@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-17T20:49:01Z","receivedAt":"2008-01-17T20:49:01Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nJohannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 17 Jan 2008, Mike wrote:\n> \n>> Johannes Schindelin wrote:\n>>\n>>> On Thu, 17 Jan 2008, Mike wrote:\n>>>\n>>>> I haven't been able to get my hands on man pages for git until this \n>>>> morning.\n>>> Googling for \"git man pages\" gives you \n>>> http://www.kernel.org/pub/software/scm/git/docs/\n>>> as first hit.  That should work even on a bare-bones CentOS.\n>> Yea, I had googled for \"git manpages\". Which doesn't.\n> \n> It does here.  Just checked.\n\n\nhttp://www.google.com/search?hl=en&q=%22git+manpages%22&btnG=Google+Search\n\nThe first result I get is :\n\nhttp://www.cygwin.com/ml/cygwin/2008-01/msg00101.html\n\nAnd nothing on the first or second page seems to point to git manpages.\n"},{"id":"65782","messageId":"alpine.LSU.1.00.0801172054580.5731@racer.site","threadId":"11638","inReplyTo":"478FBF3D.8030604@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-17T20:57:31Z","receivedAt":"2008-01-17T20:57:31Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jan 2008, Mike wrote:\n\n> Johannes Schindelin wrote:\n> \n> > On Thu, 17 Jan 2008, Mike wrote:\n> > \n> > > Johannes Schindelin wrote:\n> > > \n> > > > On Thu, 17 Jan 2008, Mike wrote:\n> > > > \n> > > > > I haven't been able to get my hands on man pages for git until \n> > > > > this morning.\n> > > > Googling for \"git man pages\" gives you \n> > > > http://www.kernel.org/pub/software/scm/git/docs/ as first hit.  \n> > > > That should work even on a bare-bones CentOS.\n> > > Yea, I had googled for \"git manpages\". Which doesn't.\n> > \n> > It does here.  Just checked.\n> \n> http://www.google.com/search?hl=en&q=%22git+manpages%22&btnG=Google+Search\n> \n> The first result I get is :\n> \n> http://www.cygwin.com/ml/cygwin/2008-01/msg00101.html\n> \n> And nothing on the first or second page seems to point to git manpages.\n\nhttp://www.google.co.uk/search?q=git+manpages&ie=utf-8&oe=utf-8&rls=org.mozilla:de:official&client=firefox-a\n\nAnd the first hit is what I said.\n\nHth,\nDscho\n"},{"id":"65783","messageId":"478FC1F4.5080200@talkingspider.com","threadId":"11638","inReplyTo":"alpine.LSU.1.00.0801172054580.5731@racer.site","subject":"Re: I don't want the .git directory next to my code.","fromName":"Mike","fromEmail":"fromlists@talkingspider.com","sentAt":"2008-01-17T21:00:36Z","receivedAt":"2008-01-17T21:00:36Z","isPatch":false,"sender":{"key":"fromlists@talkingspider.com","avatar":null},"body":"\n\nJohannes Schindelin wrote:\n> Hi,\n> \n> On Thu, 17 Jan 2008, Mike wrote:\n> \n>> Johannes Schindelin wrote:\n>>\n>>> On Thu, 17 Jan 2008, Mike wrote:\n>>>\n>>>> Johannes Schindelin wrote:\n>>>>\n>>>>> On Thu, 17 Jan 2008, Mike wrote:\n>>>>>\n>>>>>> I haven't been able to get my hands on man pages for git until \n>>>>>> this morning.\n>>>>> Googling for \"git man pages\" gives you \n>>>>> http://www.kernel.org/pub/software/scm/git/docs/ as first hit.  \n>>>>> That should work even on a bare-bones CentOS.\n>>>> Yea, I had googled for \"git manpages\". Which doesn't.\n>>> It does here.  Just checked.\n>> http://www.google.com/search?hl=en&q=%22git+manpages%22&btnG=Google+Search\n>>\n>> The first result I get is :\n>>\n>> http://www.cygwin.com/ml/cygwin/2008-01/msg00101.html\n>>\n>> And nothing on the first or second page seems to point to git manpages.\n> \n> http://www.google.co.uk/search?q=git+manpages&ie=utf-8&oe=utf-8&rls=org.mozilla:de:official&client=firefox-a\n> \n> And the first hit is what I said.\n> \n> Hth,\n> Dscho\n> \n\n\nYou didn't try my url, did you.\n\nI had put \"git manpages\" in quotes.  Google searches differently with \nquotes and without.\n\nTry my url next time. That's why I provide it.\n"},{"id":"65784","messageId":"46a038f90801171305t78fa1758l9ddf2d70890aea9f@mail.gmail.com","threadId":"11638","inReplyTo":"478EEAC4.2010006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2008-01-17T21:05:50Z","receivedAt":"2008-01-17T21:05:50Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Jan 17, 2008 6:42 PM, Mike <fromlists@talkingspider.com> wrote:\n> With PHP, Python, and Ruby, the development is the deployment.  The\n\nPlenty here use git for web apps.\n\n> There's a fundamental \"best practice\" of web development being violated\n> here- keep your docroots clean, only put stuff in them that should go\n> live (or should eventually go live when ready).  Other files should not\n> live under docroot.\n\n*First* - people here have pointed out various ways of doing this with\nthe GIT_DIR env variable. Nothing is being violated.\n\nIn terms of the best-practice you mention of publishing only the\nreachable files, your checkout is one directory higher. The top-level\ndir of your checkout should look like:\n\n  .git\n  htdocs # this is published\n  conf # configuration files\n  lib # libraries\n\nif you publish the top of your checkout, your libraries sit in there.\nAlong your .git and your config files.\n\n> Among the reasons for that is security.  If one of those .git dirs does\n> slip out and go live, it's a *huge* *gaping* *security* *hole*.  You\n\nWell -- I routinely add .git CVS and .svn to http.conf with a\ndirectorymatch clause to prevent access to them. Just in case,\nbelts-and-suspenders.\n\n> If we end up having to write a special \"publisher\" app to move files\n> from dev to live, then it will only be because of those damn .git\n> directories.\n\nNah! It'll be because of a long list of things, including temp files,\nbackup files that developers make, all sorts of things in your *work*\ndir that you really need there and you really should _not_ have in the\nproduction checkout.\n\nBTW, I also add common patterns for those temp files to httpd.conf to\nrestrict access to them.\n\n> Maybe git just isn't intended to be used for anything besides compiled\n> languages like c?  Or maybe just not for web app development?\n\nC produces a ton of intermediary files that git never commits, and C\nprojects usually get an \"installer\" too (debian's apt/dpkg, rpm, etc).\nWriting PHP/Ruby/Python produces less \"intermediary\" files, but it\nstill creates some, so there's plenty of good reasons to have an\n\"installer\".\n\nGIT does the SCM thing, but for handling your deployment you need\nsomething else. I normally use scripts that use git internally,\nwritten in make, perl or shell.\n\ncheers,\n\n\n\nmartin\n"},{"id":"65785","messageId":"alpine.LSU.1.00.0801172105180.5731@racer.site","threadId":"11638","inReplyTo":"478FC1F4.5080200@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-17T21:05:53Z","receivedAt":"2008-01-17T21:05:53Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 17 Jan 2008, Mike wrote:\n\n> I had put \"git manpages\" in quotes.\n\nWhy on earth?\n\n> Try my url next time. That's why I provide it.\n\nTry a better url next time.  Some url like mine.  A url which works.\n\nHave a nice life,\nDscho\n"},{"id":"65828","messageId":"ee77f5c20801172352t215ca8c9p2f02e4fbc72a3df3@mail.gmail.com","threadId":"11638","inReplyTo":"478FA8B0.2000205@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2008-01-18T07:52:38Z","receivedAt":"2008-01-18T07:52:38Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Jan 18, 2008 6:12 AM, Mike <fromlists@talkingspider.com> wrote:\n>\n> You guys might want to complain to the CentOS (and/or RHEL) maintainers\n> to have them put the man pages into the yum rpm. Er or whoever maintains\n> that (they maintain that rpm, right? I don't know).\n\nMaybe *you* might want to, since you were the one affected, and\neveryone else here is busy doing other things.\n\n\nDave.\n"},{"id":"65836","messageId":"47906643.2010201@op5.se","threadId":"11638","inReplyTo":"478EEAC4.2010006@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-01-18T08:41:39Z","receivedAt":"2008-01-18T08:41:39Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Mike wrote:\n> \n> \n> Linus Torvalds wrote:\n> \n>> Some people don't split this up, and they tend to make horrible \n>> horrible mistakes, like checking in the *results* of the \n>> post-processing too (ie binary result blobs that can be regenerated \n>> from the other files), because they don't make a clear separation \n>> between the parts they do development on, and the end result.\n> \n> Honestly, I think your mode of thinking is centered around compiled \n> languages and linux app(/kernel) development.  The web app \n> development/deployment model is very different.\n> \n> With PHP, Python, and Ruby, the development is the deployment.  The \n> source is the output.  You can't develop web apps in those languages \n> unless the source files you're working on are under the doc root of your \n> development server.   \"the parts they do development on\" and \"the end \n> result\" *are* the same files.\n> \n\nWe develop several different PHP packages. We have a test-server where\npandemonium reings with regards to .git directories and which branches\nare checked out where. We also have a release process, and .git dirs\n*never* end up on production servers.\n\nThe release-process is this: \"git tag -s $tag_name; git push $tag_name\".\nThe update-hook then marks the repo as having a new release and a cron-\njob, running every 5 minutes, takes care of updating our production\nservers. It took me all of 30 minutes to hack up, and not only does it\nmake sure we never publish the .git directory, it also makes it really,\nreally easy for <insert-non-git-savvy-customer-X> to report a version in\nwhich he or she has spotted a bug.\n\n> \n> There's a fundamental \"best practice\" of web development being violated \n> here- keep your docroots clean, only put stuff in them that should go \n> live (or should eventually go live when ready).  Other files should not \n> live under docroot.\n> \n\nYou accomplish that by making sure only stable and signed versions hit\nthe deployment server(s). Manual scp/rsync/ftp-mirroring of the testing\nserver's docroot is just plain stupid.\n\n> \n> Maybe git just isn't intended to be used for anything besides compiled\n> languages like c?  Or maybe just not for web app development?\n> \n\nWell, it was originally intended to manage the Linux kernel, but it's\nwritten in such a way as to be capable of competently manage just about\nanything.\n\n\n> Finally, to this statement:\n> \n>> It's almost always a bad idea to develop in the tree that is also where\n>> you \"export\" things, and if you find git annoying in this respect, ask\n>> yourself why pretty much *every*single*scm*out*there* makes their\n>> infrastructure even more noticeable (eg CVS subdirectories in every \n> single\n>> directory etc)\n> \n> I don't think that pointing at other SCM's practices as the authority is \n> the stance you really want to take. I can direct you to a video of a \n> speech by a brilliant guy, in front of some googlers, where he explains \n> that the entire reason he started the git project is because of the \n> problems with \"*every*single*scm*out*there*\".\n> \n\nThose problems aren't \"all the scm's in the world store their meta-data\nsomewhere!\" though, and the ability to tar up a working-tree and get the\ngit-directory too is not always a bad thing. It's just your release\nprocess that needs to eliminate the manual step there so you never copy\nit by accident. That's why people write small and simple scripts though.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"66299","messageId":"f9d2a5e10801220227i6dfb6185g555911f0d999fa60@mail.gmail.com","threadId":"11638","inReplyTo":"478FA8B0.2000205@talkingspider.com","subject":"Re: I don't want the .git directory next to my code.","fromName":"Russ Dill","fromEmail":"russ.dill@gmail.com","sentAt":"2008-01-22T10:27:42Z","receivedAt":"2008-01-22T10:27:42Z","isPatch":false,"sender":{"key":"russ.dill@gmail.com","avatar":"https://gravatar.com/avatar/989b24f3fa63126a35d7c74069e2626e715a3b1a86616be9962f7ceae04ff9c5?d=mp&s=160"},"body":"> Linus posted a response about deployment and development being\n> separated, so I had to point out why that doesn't work for web apps in\n> interpreted languages.\n>\n\nIf your primary concern is preventing information leakage, then a\npublish model is absolutely what you want. You definetely don't want\nsome random intermediary file out on the server, or some file that was\nnever checked into source control.\n\nBy publish, I don't just mean to the public server, I also mean to\nwhatever development roots you have.\n\nWith a good publishing model and a good SCM, you also get\nreproducibility and testability as well. Its easy to ensure that what\nis checked into source control is what you are testing, and its easy\nto rollback production servers to a different version.\n"}]}