A git plugin to create an empty git repository
$ git empty
Initialized empty Git repository in /path/to/here/.git/
[master (root-commit) dd22b2e] Empty.
Now you have a git repository with a valid branch which contains nothing.
No, it's not. git init
doesn't create a branch and you still need to make a commit to have a branch.
It is a good practice to start a repository with a blank first commit. There are cases, where having an empty commit as the first commit would come handy. For example, when you need to create a branch that contains no history.
Add git-empty
to your $PATH
and now you can run git empty
as a git subcommand.
This is how you can write a subcommand of your own. Anything in $PATH
prefixed with git-
will become a git subcommand.