$ HOME git repo (optional) on github?

I keep a lot of files in my home directory under git . Important dotfiles, my thesis, etc.

I want to click specific files on github, for example my emacs configuration, to share.

Obviously, I don't want to push the entire repo. Are there submodules path?

My first thought is to make the ~/github/emacs and rsync directory the sample files here, and then add a submodule under this directory, pointing to github to click on.

Is this a good idea, or is there a better way?

(I don’t want my local git repository to save all files to get confused in this stuff.)

+4
source share
3 answers

I store my dotfiles (and other configuration) on github. My approach is to have all these files only inside the repo and symbolize them in place using the rake task. This has the advantage that your actual home directory is not inside the git repository, and you do not need to deal with submodules anywhere, as this will probably become useless for maintenance (and prevent the reuse of your dotfiles and other things). For inspiration, my dotfiles repository can be found here: https://github.com/meineerde/dotfiles

Generally, I would advise you to use smaller git repositories, one for each individual project. You should also try to ensure that your repository structures (e.g. submodules) simply simplify maintenance. Just put your stuff side by side and create a new git repository for each new project.

I would refuse to use hardlinks (as suggested by Martinho Fernandes), since the connection can be easily broken by some file system operations, and it is not really obvious that there are hard links.

+6
source

You can create the ~/github/emacs directory and put hardlinks for the actual files there.

0
source

I don't like to use symbolic links for my dotfiles git directory, since it is so painful to track. I switched to using the internal .git directory and git alias; here is my version entry for git domains .

0
source

Source: https://habr.com/ru/post/1339218/


All Articles