When I do commit --amend, it is unsafe commit if the commit already has been pushed to remote repository.
I want to detect unsafe commit --amend by pre-commit hook and a
Following @Roger Dueck's answer, ended up doing:
#./.git/hooks/prepare-commit-msg IS_AMEND=$(ps -ocommand= -p $PPID | grep -e '--amend'); if [ -n "$IS_AMEND" ]; then return; fi