I'm versioning my $HOME with git, but with an differently-named repository directory so that my prompt doesn't always show git information.
I have setup an alias for when I want to use git on my $HOME:
alias gith='git --git-dir=/home/ravi/.githome --work-tree=/home/ravi'
The repository directory .githome itself shouldn't be showing up in a gith status, but it is:
~$ git --git-dir=/home/ravi/.githome --work-tree=/home/ravi status -s
M .dotfiles
M .githome/COMMIT_EDITMSG
M .githome/index
M .githome/index.lock
M .githome/logs/HEAD
M .githome/logs/refs/heads/master
M .githome/refs/heads/master
M .local/share/fzf
M bin
M lib
M prj/sample_app
I'm trying to ignore the directory .githome as follows:
~$ grep .githome .gitignore
/.githome/
~$ cat .githome/.gitignore
*
Questions:
- Why aren't my two exclude files working?
- Why do I need to explictly exclude the repository directory anyway?