I have a git repository of my dot-files in my home directory.
Every time I use a git command (e.g. git log
) in a subdirectory, which doesn't have it's own repo, I'm getting the log of the dot files repo, e.g.
/home/dimid $ cd foo
/home/dimid/foo $ git status
... log of ~/.git
However, I would like to confine my dot-repository only to files and directories that begin with a dot (e.g. .vim
), such that when I'm in ~/foo
and ~/foo/.git
doesn't exist git log
will output the usual
fatal: Not a git repository (or any of the parent directories): .git
even though that the parent directory ~
contains a .git
folder.
I thought about aliasing git
and add an exception, is there a more elegant way?