views:

77

answers:

1

I use subversion's in-place import (read for details) for configuration file version control in /etc and my home directory. It works well for me, but I've been seeing alot better/faster version control systems cropping up and want to convert. I tried mercurial, and it doesn't really support this feature of checking out a working copy of a single subfolder in a repository- it seems to want you to check out the whole thing at once.

Do other version control systems allow this? I've only tried cvs, mercurial, and subversion. Examples welcome.

+1  A: 

For git (assuming it is installed already):

cd /etc
git init-db
chmod og-rwx .git
git add .
git commit -a -m"initial import"

More elaborated version with automatic update when apt is used:

Maintain /etc with git


For Mercurial (assuming it is installed already):

cd /etc
hg init
chmod og-rwx .hg
hg add
hg ci -m "initial checkin"

More elaborated version with automatic update when apt is used:

Maintain /etc with mercurial

jitter
I see that those both make a new repository out of /etc is there an alternative method that would allow me to add /etc as a subfolder to an already-existing repository? Or in turn, check out/clone only that subfolder?
There is no real way for partial or sparse checkouts for git (although under development I think) but in git there is no real overhead to have multiple repositories. For Mercurial I'm not sure. But you can google yourself using "mercurial partial checkout" or/and "mercurial sparse checkout" as keywords
jitter