That's impossible. Git does not yet have "create this repository on the remote host and then populate it using this history" in its protocol. I have seen this being discussed on tha main Git list, but the results were inconclusive (kind of "doable but no one needs this anyway so no one bothers to implement").
I should add that the approach suggested in the answer you linked to is pretty uh… strange, in particular the idea of first doing a local bare cloning.
What you should do instead is:
- Log in to the remote host via SSH.
- Create the remote directory using
git init --bare
. Make sure it has proper access permissions etc.
- Log out.
Push what's needed from your local repository there. Usually this amounts to running
git push <that_repo> +refs/heads/*:refs/heads/* +refs/tags/*:refs/tags/*
If you intend to further communicate with that repository from your local repository you might consider first adding it as a named remote, like
git remote add quux ssh://user@server/path/to/the/repo.git