I am playing around with git and gitolite recently. Setting up a git server using gitolite is very simple. Authentication is done using ssh, configuring the repositories can all be done from the client by just pushing new configurations into an admin repository. Very convenient. Creating a new repository on the server is as easy as adding a new configuration to the config file and pushing it to the server. However, what didn’t work was pushing something into this new repostory. The reason is that pushing into an emtpy repository needs a special command in git, what I didn’t know. You basically have to add some files, commit them and then do a
git push origin master
However, that still requires to add some files. This might not always be convenient, and thanks to this post I found out that the following also works on an empty repository:
git commit --allow-empty
git push origin master
Probably this is not new to people using git for a longer time, but I thought it is a good idea to document this for future reference.