First, you’ll need to install the client. If you’re using Ubuntu, you’ll want apt-get. Obviously RHEL based systems, use yum. If you do not have either, you’re hopefully smart enough to install git from source.
# apt-get install git
# yum -y install git
Great. Assuming that went successfully, you should now be able to run “git” and see the usage output.
Creating new repositories:
# mkdir myrepo
# cd myrepo
# git –bare init
Initialize and Commit
If you have an existing project in a folder, you can commit this as an initial import into your new repository. To do this, cd into the folder in question and do the following:
# git init
# git add .
# git commit -a -m ‘my first push’
# git remote add origin firstname.lastname@example.org:myrepo
# git push origin master
Creating an SSH key
You’ll want to create an SSH key to allow you to quickly pull and push to your remote repository.
# ssh-keygen -t dsa
# scp .ssh/id_dsa.pub email@example.com:
# ssh firstname.lastname@example.org
# cat id_dsa.pub >> .ssh/authorized_keys
# chmod 644 .ssh/authorized_keys