4 ms·
I tried this but git uses ~/.git for any subdirectory of $HOME. For example, if you type `git add .` while in ~/code/some-project, you will add it to your dotfi
by sciencerobot 10y ago
I tried this but git uses ~/.git for any subdirectory of $HOME. For example, if you type `git add .` while in ~/code/some-project, you will add it to your dotfiles repository. It's easy to undo but still kind of annoying.
- nebulous1 10y agoYou can add export GIT_CEILING_DIRECTORIES=~ to your .bashrc (or equivalent)
- justinmk 10y ago> For example, if you type `git add .` while in ~/code/some-project, you will add it to your dotfiles repository. If your project has its own .git directory, no, it won't add to ~/.git.
- sciencerobot 10y agoYou're right. I forgot to mention that this only happens if you haven't initiated a new git repository in the directory you're working in.