git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: I don't want the .git directory next to my code.

From
Andreas Ericsson <ae@op5.se>
Date
Jan 18, 2008, 08:41 UTC
Message-ID
<47906643.2010201@op5.se>
In-Reply-To
<478EEAC4.2010006@talkingspider.com>
Mike wrote:
Show 20 quoted lines
> 
> 
> Linus Torvalds wrote:
> 
>> Some people don't split this up, and they tend to make horrible 
>> horrible mistakes, like checking in the *results* of the 
>> post-processing too (ie binary result blobs that can be regenerated 
>> from the other files), because they don't make a clear separation 
>> between the parts they do development on, and the end result.
> 
> Honestly, I think your mode of thinking is centered around compiled 
> languages and linux app(/kernel) development.  The web app 
> development/deployment model is very different.
> 
> With PHP, Python, and Ruby, the development is the deployment.  The 
> source is the output.  You can't develop web apps in those languages 
> unless the source files you're working on are under the doc root of your 
> development server.   "the parts they do development on" and "the end 
> result" *are* the same files.
> 

We develop several different PHP packages. We have a test-server where pandemonium reings with regards to .git directories and which branches are checked out where. We also have a release process, and .git dirs *never* end up on production servers.

The release-process is this: "git tag -s $tag_name; git push $tag_name". The update-hook then marks the repo as having a new release and a cron- job, running every 5 minutes, takes care of updating our production servers. It took me all of 30 minutes to hack up, and not only does it make sure we never publish the .git directory, it also makes it really, really easy for <insert-non-git-savvy-customer-X> to report a version in which he or she has spotted a bug.

Show 6 quoted lines
> 
> There's a fundamental "best practice" of web development being violated 
> here- keep your docroots clean, only put stuff in them that should go 
> live (or should eventually go live when ready).  Other files should not 
> live under docroot.
> 

You accomplish that by making sure only stable and signed versions hit the deployment server(s). Manual scp/rsync/ftp-mirroring of the testing server's docroot is just plain stupid.

> 
> Maybe git just isn't intended to be used for anything besides compiled
> languages like c?  Or maybe just not for web app development?
> 

Well, it was originally intended to manage the Linux kernel, but it's written in such a way as to be capable of competently manage just about anything.

Show 15 quoted lines
> Finally, to this statement:
> 
>> It's almost always a bad idea to develop in the tree that is also where
>> you "export" things, and if you find git annoying in this respect, ask
>> yourself why pretty much *every*single*scm*out*there* makes their
>> infrastructure even more noticeable (eg CVS subdirectories in every 
> single
>> directory etc)
> 
> I don't think that pointing at other SCM's practices as the authority is 
> the stance you really want to take. I can direct you to a video of a 
> speech by a brilliant guy, in front of some googlers, where he explains 
> that the entire reason he started the git project is because of the 
> problems with "*every*single*scm*out*there*".
> 

Those problems aren't "all the scm's in the world store their meta-data somewhere!" though, and the ability to tar up a working-tree and get the git-directory too is not always a bad thing. It's just your release process that needs to eliminate the manual step there so you never copy it by accident. That's why people write small and simple scripts though.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Martin LanghoffNext: Junio C Hamano
Message 32 of 65 in “I don't want the .git directory next to my code.”
  1. MikeJan 16, 2008
  2. Randal L. SchwartzJan 16, 2008
  3. MikeJan 16, 2008
  4. David SymondsJan 16, 2008
  5. MikeJan 16, 2008
  6. SeanJan 16, 2008
  7. MikeJan 16, 2008
  8. Neil MacnealeJan 16, 2008
  9. MikeJan 16, 2008
  10. Johannes SchindelinJan 16, 2008
  11. Linus TorvaldsJan 16, 2008
  12. Linus TorvaldsJan 16, 2008
  13. MikeJan 17, 2008
  14. Kris ShannonJan 17, 2008
  15. Wincent ColaiutaJan 17, 2008
  16. Jeff KingJan 17, 2008
  17. Linus TorvaldsJan 17, 2008
  18. Johannes SchindelinJan 17, 2008
  19. Linus TorvaldsJan 17, 2008
  20. Johannes SchindelinJan 17, 2008
  21. MikeJan 17, 2008
  22. Johannes SchindelinJan 17, 2008
  23. MikeJan 17, 2008
  24. Johannes SchindelinJan 17, 2008
  25. MikeJan 17, 2008
  26. Johannes SchindelinJan 17, 2008
  27. MikeJan 17, 2008
  28. Johannes SchindelinJan 17, 2008
  29. David SymondsJan 18, 2008
  30. Russ DillJan 22, 2008
  31. Martin LanghoffJan 17, 2008
  32. Andreas EricssonJan 18, 2008
  33. Junio C HamanoJan 16, 2008
  34. Ping YinJan 17, 2008
  35. Linus TorvaldsJan 17, 2008
  36. Dan McGeeJan 16, 2008
  37. MikeJan 16, 2008
  38. Mike KrierJan 16, 2008
  39. MikeJan 16, 2008
  40. Nguyen Thai Ngoc DuyJan 16, 2008
  41. David SymondsJan 16, 2008
  42. MikeJan 16, 2008
  43. Daniel BarkalowJan 16, 2008
  44. Luke LuJan 16, 2008
  45. MikeJan 16, 2008
  46. Sam VilainJan 17, 2008
  47. Daniel BarkalowJan 16, 2008
  48. MikeJan 16, 2008
  49. Johannes SchindelinJan 16, 2008
  50. Bert WesargJan 16, 2008
  51. Wayne DavisonJan 16, 2008
  52. Matthieu MoyJan 16, 2008
  53. Johannes SchindelinJan 16, 2008
  54. Bill LearJan 16, 2008
  55. Matthieu MoyJan 16, 2008
  56. Johannes SchindelinJan 16, 2008
  57. Junio C HamanoJan 16, 2008
  58. Johannes SchindelinJan 16, 2008
  59. Matthieu MoyJan 16, 2008
  60. Johannes SchindelinJan 16, 2008
  61. Jakub NarebskiJan 16, 2008
  62. Brian DowningJan 17, 2008
  63. Randal L. SchwartzJan 17, 2008
  64. Martin LanghoffJan 17, 2008
  65. Randal L. SchwartzJan 17, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.