Setting up Git

NOTE: There are already many articles like this on the internet that describe this process in detail. The main reason for this post is as a reference for myself and others that already understand the basic structure of Unix and Git to make sure everything is set up. It is NOT FOR BEGINNERS!

For this post, I assume you have a fresh install of the latest Git (Not GitHub) on your computer. You can get it from http://git-scm.com/downloads

Setting up Git is really easy if you know all the commands. First, we want to set your name and email so that other users know who you are. (This is only for identification purposes)

git config --global user.name 'Bernhard Breytenbach'
git config --global user.email 'name@example.com'

If you want Git to remember your passwords for some time, use:

git config --global credential.helper cache
# Default timeout is 15 minutes
git config --global credential.helper 'cache --timeout=3600'
# Set custom timeout to 1 hour (in Seconds)

Generate SSH Key for password-less login [Read More]

ssh-keygen -t rsa

This will create two files in your .ssh directory. id_rsa and id_rsa.pub. id_rsa is your private key. This is a top secret file. Keep it safe! id_rsa.pub is your public key. Add it to your server’s authorized_keys file.

To setup git on a server, check out this tutorial!

Thats it. Next we will take a look on how to customize our setup for effective Web Development! Feel free to leave a comment if you think I missed anything!

Leave a Reply

Your email address will not be published. Required fields are marked *