Tue, 04/17/2012 – 13:22 admin
At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same dudes that created Linux, Git is responsible for everything GitHub related that happens locally on your computer. If you don’t already know what Git is, I am here to help you 🙂
Step 1: Create an account on github.com, if you don’t have one.
Step 2: Download and install the latest version of Git with Synaptic. I will suggest you install git-core, git-gui, and git-doc.
From GUI: Go to Applications->System->Synaptic Package Manager. With “ALL” package choose from left pane, scrool down and when you’ve selected git-core, git-gui, and git-doc, hit “Apply” to install them.
*Note* In newer Debian/Ubuntu installations you will find git instead of git-core.
From Command Line: sudo apt-get install git-core git-gui git-doc
Step 3: Set Up SSH Keys
We use SSH keys to establish a secure connection between your computer and GitHub. Setting them up is fairly easy. To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.
$ ssh-keygen -t rsa -C “firstname.lastname@example.org”
– Creates a new ssh key using the provided email. When prompted, you need to enter a passphrase.
This is it. you are done.
Step4: Add your SSH key to GitHub.
- On the GitHub site Click “Account Settings” > Click “SSH Public Keys” > Click “Add another public key”
- Open the /home/your_user_directory/.ssh/id_rsa.pub file with a text editor. This is your public SSH key. It’s important you copy your SSH key exactly as it is written without adding any newlines or whitespace. Now paste it into the “Key” field.
- Hit “Add Key.”
Step5: Test everything out
To make sure everything is working you’ll now SSH to GitHub.
$ ssh -T email@example.com
When prompted for authenticity (yes/no), say yes. You will see successful authentication message then.
Step 6: Set Up Your Info
Now that you have Git set up and your SSH keys entered into GitHub, it’s time to configure your personal info.
- Set your username and email.
Git tracks who makes each commit by checking the user’s name and email. In addition, we use this info to associate your commits with your GitHub account. To set these, enter the code below, replacing the name and email with your own. The name should be your actual name, not your GitHub username.
$ git config –global user.name “Firstname Lastname”
Sets the name of the user for all git instances on the system
$ git config –global user.email “firstname.lastname@example.org”
- Set your GitHub token.
Some tools connect to GitHub without SSH. To use these tools properly you need to find and configure your API Token. On the GitHub site Click “Account Settings” > Click “Account Admin.” Copy api token provided dere.
At the command line run the following code, using your GitHub username and token in place of the ones shown.
$ git config –global github.user username
Sets the GitHub username for all git instances on the system
$ git config –global github.token 0123456789yourf0123456789token
Sets the GitHub token for all git instances on the system
*Note* If you ever change your GitHub password, a new token will be created and will need to be updated.
Step 7: Time for a Coffee
Congratulations, you now have Git and GitHub all set up!.