0

I wish to version control my .vimrc ,.Xresources and various other dot files for convenience but would like to separate them so all wouldn't be deployed together.

Two ideas came to my mind first is to have one git repo and various branches per each group of dot files. Problem with this method is that then I have to create merged branches for each installation to combine these groups.

The second idea is to have serveral git repos in one directory for each group of files but I don't know if it is possible.

Any ideas? and thank you very much.

S.Rad
  • 307
  • 2
  • 10
  • "*Problem with this method is that then I have to create merged branches for each installation to combine these groups.*" Not necessary. You'd better separate storing files in a VCS and deploying them. With such separation you don't need to merge branches but run your deployment tool for a few different branches. – phd Jan 01 '20 at 13:06
  • @phd Do you mean I should write a deployment script checking out branches copying their files to the destination? – S.Rad Jan 01 '20 at 13:22
  • Yes, something like that. – phd Jan 01 '20 at 13:24
  • Thank you I'll consider but yet want to search for a more convenient way. – S.Rad Jan 01 '20 at 13:26

1 Answers1

0

The second idea is to have several git repos in one directory for each group of files but I don't know if it is possible.

Here is a good starting point for getting some ideas and options: https://codeburst.io/4-git-submodules-alternatives-you-should-know-592095859b0


Common options

You should look at git submodules and git subtree

Git submodules

enter image description here


Subtree

enter image description here credit: https://ittennull.gitlab.io/subtree-updater-blog/part2/

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
  • I appreciate your effort but neither git submodules nor git subtree addresses the problem of having several git repositories under the same directory since they are in subdirectories of the main repo and not the same directory. Git repositories are identified with their Git databases namely .git file; I want to have several Git databases under the same directory to have different files in different repositories. – S.Rad Jan 01 '20 at 20:53
  • You cant have multiple git repo under the same parent folder, they have to be each on in its own folder, what you can do is to write a script which pulls the content form multiple repos into the parent folder – CodeWizard Jan 01 '20 at 21:02
  • Then I guess writing a script is inevitable. – S.Rad Jan 01 '20 at 22:00