All pastes #252921 Raw Edit

Miscellany

public text v1 · immutable
#252921 ·published 2006-11-20 02:37 UTC
rendered paste body
# 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) )
	)
}