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
Junio C Hamano <gitster@pobox.com>
Date
Jan 16, 2008, 19:23 UTC
Message-ID
<7v8x2pr2w4.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.1.00.0801161000310.2806@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 16 quoted lines
> Let me do a few examples of why this is a good idea:
>
>  - the whole point of development trees and SCM's (and that's *especially* 
>    true with git) is how you can try things out, go backwards in time, and 
>    generally just do *development*.
>
>    If you do that in what is your public deployment area, you're already 
>    very limited. Not only may you not want to make that .git directory 
>    accessible to others (while you *do* obviously want to make the 
>    deployment itself), you also end up exposing things like your 
>    management scripts and source code along with "generated files" etc 
>    that are the things you actually want to deploy.
>
>    Yes, it's certainly quite possible that you simply don't have any 
>    management scripts etc, and that you don't generate any files, and you 
>    simply want to just deploy the exact files that you also want to track. 

Even without any management script, you cannot do any _development_ in such a tree. By definition, mucking with the files in the deployment area means all of your changes are immediately visible by the clients.

One reason (admittedly misguided) people mentioned why they want to do this is because they want to be able to "git-add" files generated on the deployed server by client actions (think of a Wiki that drops new contents in an area writable by the webserver). If your deployment area is _not_ managed by git, they instead need to write a Makefile target in their development area that takes new/modified files back to the development tree and "git-add" those copies.

The right way to manage these client-generated contents would of course be to commit them to a branch separate from the sources you develop (otherwise your history will be a mixed mess between the true development and client content changes), so the argument is very weak and is not a good justification for wanting to have deployment and development tree as one.

But I can well imagine that it is a tempting way to work for people who have not thought about the reason why history matters, especially for the ones who still suffer from CVS braindamage that makes separate branches inpractical.

Previous: Andreas EricssonNext: Ping Yin
Message 33 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.