Also, in order to receive pushes, the server has to have a configuration in git:
git config receive.denyCurrentBranch ignore