Miscellany
public text v1 · immutable# Reset $1 (default: current HEAD) to a null commit
git_nullify() {
(
export GIT_AUTHOR_NAME=null
export GIT_COMMITTER_NAME=null
export GIT_AUTHOR_EMAIL=null
export GIT_COMMITTER_EMAIL=null
export GIT_AUTHOR_DATE='+0000 1990-01-01 00:00:00'
export GIT_COMMITTER_DATE='+0000 1990-01-01 00:00:00'
export GIT_INDEX_FILE=.git/tmp/empty_index
git update-ref "${1:-HEAD}" $( echo null | git commit-tree $(git write-tree) )
)
}