When I create a new project I always put into my Git repository; and every time I realize I have forgot the exact command sequence to do that. Actually, it’s quite simple.

First, we login on the remote machine, create a folder for the project and initialize the repository:

$ ssh user@server.dom
$ mkdir /path/to/project
$ cd /path/to/project
$ git init --bare
$ git update-server-info # If planning to serve via HTTP
$ exit

Then, on the local machine, we can initialize the repository, link it to the remote one, and commit our initial version:

$ cd local/repository/project
$ git init
$ git add *
$ git commit -m "My initial commit message"
$ git remote add origin user@server.dom:/path/to/project
$ git push -u origin master

To clone:

$ git clone user@server.dom:/path/to/project

(thanks to thelucid.com)