In Git it is usually a good practice to have the repo on the server to which other people push to be a bare repository. It is highly recommended.
git init . --bare
Here it is failing because you are pushing to a non-bare ( with a working copy ) repo and to the branch that is checked out.