DEV Community

Discussion on: How I Backup/Sync my Dotfiles & Apps

Collapse
 
loirotte profile image
Philippe Dosch • Edited

Creating a git repository in a home is not a good practice, for a lot of reasons (especially as it basically works recursively). Your first commit is a good illustration: you add all your files, then remove those you do not want to consider. And you will have to keep in mind and perpetuate this scheme potentially each time a new critical file will be added.

Why do not consider an appropriate and standard tool like vcsh (github.com/RichiH/vcsh)? You find it in standard Linux distributions, it even allows multiple repos (if needed) in home and do not change the common workflow: you only add the files you need in repos.

Collapse
 
biros profile image
Boris Jamot ✊ /

In fact, it's the opposite of what you describe: it's a whitelist. First you ignore ALL, then you add the files you want to save.
Maybe it's not the best way but it's quite simple and it does the job ☺️
Thanks for your suggestion, I'll have a look on it !

Collapse
 
loirotte profile image
Philippe Dosch • Edited

Yep, you're right, I misspoke :-) I described the technical steps instead of the conceptual ones (as you initially add your files to a blacklist). Nevertheless, the facts are still there with your workflow: if you insert in your home a new file, independent of your project, you will have to add it to the .gitignore. However, as it is independent it shouldn't involve side effect on your project.

vcsh has been developed for this kind of purposes and helps you to keep a clean workflow. And if you have several repos in your home (for my own, I have an emacs repo, a zsh repo, etc.), you can couple it with mr (multiple repositories) in order to manage them more efficiently.

Thread Thread
 
biros profile image
Boris Jamot ✊ /

No, if I insert a new file in my home, it will be automatically ignored by my git config.

Thread Thread
 
loirotte profile image
Philippe Dosch

Oups, it's echo "*" and not echo * :-)