macOS • NeoVim • Kitty • Fish • Tmux
Victor Mono Nerd • Moom • Nord
To set up a new machine to use your version controlled config files, all you need to do is to clone the repository on your new machine telling git that it is a bare repository:
git clone --separate-git-dir=$HOME/dotfiles https://github.com/voitd/dotfiles.git
However, some programs create default config files, so this might fail if git finds an existing config file in your $HOME. In that case, a simple solution is to clone to a temporary directory, and then delete it once you are done:
git clone --separate-git-dir=$HOME/dotfiles https://github.com/voitd/dotfiles.git tmpdotfiles
rsync --recursive --verbose --exclude '.git' tmpdotfiles/ $HOME/
rm -r tmpdotfiles
There you go. No symlink mess.
The aliases will just print out the contents of the commit types file into my terminal.
alias commit-types='cat ~/dotfiles/.gitmessage'
alias ct='cat ~/dotfiles/.gitmessage'
Then just set globally on your git to use above file as template for all your commit with the command:
git config --global commit.template ~/.gitmessage
And voilà ....any time you send commit message on your repo git will pick up that file and you will never forgot about your commit types!