- Suppose you are new to git and github and you want to use it quickly. This is the situation I write this post.
- Get a free account of github, that’s easy for you guys.
- Install the git on Windows or Linux, that’s easy too.
- Then I use the Ubuntu as an example.
- After you install git, open git bash and configure you git, like your user name and email of your github account.git official tutorial
$ git config --global user.name "John Doe"
$ git config --global user.email email@example.com
- Then get your local ssh key and copy it to your github account, git official tutorial
$ ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
- This creates a new ssh key, using the provided email as a label.
Generating public/private rsa key pair.
- When you’re prompted to “Enter a file in which to save the key,” press Enter. This accepts the default file location.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
- At the prompt, type a secure passphrase. And if you want to skip the password, just press Enter twice and it will be done.
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
- After you generate your ssh key, go to the destination and open the id_rsa.pub and copy the contents like this:
- Then log in your github account and find the setting part
- And then from the left menu to find the SSH and GPG Keys
- Click the right button and add new ssh key
- You will be asked add the title and ssh key
- Now go back to your git bash, and type into
ssh -T email@example.com
- You will get the response like this
- That means you connect to your github successfully! Congratuations!
- Since you have configured your git and github, let’s do a simple practice now. Go to Part2