I’ve started to put some files in version control in mercurial. It started with .vim, and then with .bashrc, and now I realized a lot of other files could be versioned as well (such as .zshrc, .task directory created by taskwarrior, etc)
Fact is I would like to know which approachs are available and how people here in SO do it.
Versioning home is not a good idea since I would need to edit my .hgignore, and each time a new folder I don’t want versioned is added I would need to edit .hgignore as well.
So I think of 2 approaches:
- Create a “dotfiles” repo with everything inside it (vim, bash, screenrc), clone it in home and create symbolic links in home to them;
- Create a “dotfiles” repo and a repo for each configuration (vim, bash, screenrc, cvsrc, etc). This “dotfiles” repo will just have the other repositories as submodules, but creation of symbolic links in home is still needed.
Do you think it’s overkill to create a repository for each configuration in the second approach? Do you have another suggestions? I would like to use this approach on linux/mac. I use vim on windows as well, that’s why I tought of making different repositories with submodules – in windows I would just clone the vim repo: the home repo would have vim as a submodule.
(I’m using a bitbucket private account. Is it possible to have submodules in there? And one more thing: is it possible to have git submodules inside a mercurial repository as submodules as well? How?)
Thanks!
Although all answers were great, I decided by my own solution.
I’m going to create two repositories: vim and home (I use vim in different operating systems, *nixes and windows, so it’s worth having separate repositories for that). Vim is going to be a subrepo in home.
Home is going to be a dotfiles folder, having a bash script that symlinks everything, so I can clone my repo and just run the script.