Simply read
Pro Git Book: 4.2 Git on the Server - Getting Git on a Server
which boild down to
$ git clone --bare my_project my_project.git
Cloning into bare repository 'my_project.git'...
done.
Then put my_project.git to the server
Which mainly is, what answer #42 tried to point out. Shurely one could reinvent the wheel ;-)