I'm looking for an open source version control system that can be configured to track only a small number of individual files spread around the filesystem. Something like the opposite of .gitignore .
The use case is keeping track of changes that I make after installing an OS. Many of the changes are outside /etc, so I cannot just have /etc under revision control. And having / under revision control seemed very slow with git.
It seems that I can use a .gitignore as follows. To track, say, /usr/share/terminator/terminator :
*
!/usr
/usr/*
!/usr/share
/usr/share/*
!/usr/share/terminator
/use/share/terminator/*
!/usr/share/terminator/terminator
But this seems a bit clumsy (even if I were to auto-generate the .gitignore). Is there a better way (or a more appropriate version control system for this)?
I think you can use another work around for this with git. Note that git continues tracking a file even if it is in ignore rules, once it is already being tracked. So, assuming that you do not want to track new files very often,
Add all the files that you actually want to track
Commit these files using
Add an ignore rule to your
.gitignore
to ignore all other filesNow if you make changes to any of the existing files, they will show up in
git status
,git diff
and so on. You can add them usinggit add filename
and operate upon them normally.To add a new file next time onwards, you need to use
-f