Initialize new git repo with a blank commit


It is useful to have a completely empty commit as the first commit. This is the command to do that:

GIT_AUTHOR_NAME='nil' \
GIT_AUTHOR_EMAIL='[email protected]' \
GIT_COMMITTER_NAME='nil' \
GIT_COMMITTER_EMAIL='[email protected]' \
GIT_AUTHOR_DATE='1970-01-01 00:00:01' \
GIT_COMMITTER_DATE='1970-01-01 00:00:01' \
git commit --no-gpg-sign --allow-empty -m 'NIL'

source

Date: 2021-01-03

Tags:  git

Share: