$ mkdir ~/.config.gitNow I have a git repository called
$ cd ~/.config.git
$ git init --bare
$ git config core.worktree ../
~/.config.git, but it needs special environment variables set so that accidentally calling
gitoutside a normal repository won't trigger it to do things to my config repo. The next step is to make it easier to use this repo. I wrote the following to
#!/bin/bashNow calling "
git home ..." explicitly sets the repository to my config repo. But this still isn't so convenient. So I added the following to my (now version-controlled)
.bashrcfile, at a point after completions are loaded:
alias hgit='git home'This sets up
complete -o bashdefault -o default -o nospace -F _git hgit 2>/dev/null \
|| complete -o default -o nospace -F _git hgit
hgitwith completions. Finally, I don't want
hgit statusto show tons of untracked files. So I added the following
[^.]*Beneath that is a list of specific exclusions, which I'll keep expanding as I discover files and directories I don't want to track.