3 ms·
I just made ~/.git and ignore everything with .gitignore, whitelisting files I want to commit: https://github.com/burke/dotfiles/blob/master/.gitignore https://
by burke 12y ago
I just made ~/.git and ignore everything with .gitignore, whitelisting files I want to commit: https://github.com/burke/dotfiles/blob/master/.gitignore https://github.com/burke/dotfiles/blob/master/.gitignore
It works really well for me.
- dietrichepp 12y agoI remember giving advice once, to someone who did that and then git clean -dfx
- zokier 12y agoThat is especially problematic with gits directory traversal behavior. If you are in a wrong directory inside your home, you might accidentally nuke your homedir instead of the intended repo.
- burke 12y agoThat is terrifying. I just added this to my zshrc: git() { local toplevel=$(command git rev-parse --show-toplevel 2>/dev/null) if [[ "${toplevel}" == "${HOME}" ]] && [[ "$1" == "clean" ]]; then >&2 echo "Do NOT run git clean in this repository." return fi command git "$@" }