How to create a remote Git repository from a local one?

Question

I have a local Git repository. I would like to make it available on a remote, ssh-enabled, server. How do I do this?

Answer

I think you make a bare repository on the remote side, git init --bare, add the remote side as the push/pull tracker for your local repository (git remote add origin URL), and then locally you just say git push origin master. Now any other repository can pull from the remote repository.

What is the difference between git pull and git fetch + git rebase?

rejected master -> master (non-fast-forward)