3 ms·
I remember giving advice once, to someone who did that and then git clean -dfx
by dietrichepp 12y ago
I 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 "$@" }