You are not logged in.
This seems to be quite popular, I've seen a lot of people using git repositories to store their configuration files. The most common approach is to keep the files in a git repository and link to them from $HOME, $HOME/.config and so on.
I've used this for a few years, it works for very simple scenarios but has some problems:
* Some applications (or even myself) might remove a file and recreate it; then it's no longer a symlink.
* Git does not store permissions exactly. It only preserves the execute bit.
* Git does not store ownership info. So this doesn't work well for files owned by different users. That means if you want to track stuff from /etc as well, you will have to either create another repository owned by root, or change ownership to your own user.
* Having symlinks all over the place looks ugly.
So I wrote 3 bash scripts:
* one that makes copies of the files from the system to the git repo, and also stores the original metadata (owner, group, permissions) in a separate file
* another script to copy these files to the system, restoring also the metadata
* a script to do a diff between the repo and the system
Setting which files must be tracked is done by adding their paths to a text file, one per line.
I think this is the simplest we can get.
Everything is here with a readme: https://gitlab.com/o9000/dotfiles-template
Use it on your own risk And don't store passwords, ssh keys and the like in the cloud, not even in private repositories. git is not the right tool for that.
Other approaches are using git-cache-meta or metastore, which help with preserving permissions, but you'd still need a bit of boilerplate to manage which files are tracked and to save/restore/diff.
Offline
Great! I must to try it
Offline