Multiple projects in a single git repository.
August 6, 2008 9:23 PM
Subscribe
How do I work on multiple projects in a single version control (hopefully git) repository. Alternatively, how do I transparently establish many repositories for different projects?
After an embarrassingly long time of poor version control, I decided that it's time to be careful about all my code and documents, and tried to establish a central repository. I have 2 machines: a server which acts as an occasional development machine and does backup, and my laptop. I'm hoping version control will help me keep my work synced between the two machines as well.
The key problem is that git commands operate on the whole repository, not just a particular directory. So if I make some changes in the work directory, and then modify elements of the play directory, running 'git status' inside the play directory informs me of the work changes. Branching in the play directory also puts the work directory on the same branch. With many subprojects, that's really annoying; I would much prefer git operations to apply only to the current and children directories, not parent ones.
Alternatively, I can imagine creating two repositories: a work and play one. However, then whenever I make a new project, I have to init a repository on one machine, pull it on the other; whenever I want to sync the 2 machines; I would need to git pull every single project. It feels like there has to be a better way.
I suspect that some branch trickery may work -- if every project is a separate branch in the same repository, that may be OK -- however, that won't solve the easy sync problem, and feels like a total abuse of branches. Any suggestions?
posted by bsdfish to computers & internet (5 comments total)
1 user marked this as a favorite
posted by hattifattener at 9:55 PM on August 6, 2008