First machine:
git init --bare gitrepo.git
Second machine:
git clone user@server:~/gitrepo.git
cd gitrepo
touch test
git add test
git commit -a
# '-u' tells git to track the remote master branch with your local master branch
git push -u origin master