Part02: Connecting Git with Github

What is github

You have many times heard me talking about Github, but what IS github actually? Github is actually a bunch of free remote repositories and you can push your local repository there.

Connecting to Github by SSH(reccommanded)

Github uses SSH access, thus you need to generate a SSH key.

1. open git bash, and type or paste ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

2. press enter to accept the default path

3. type your wanted passphrase twice, but you can simply enter to avoid passwords

4. type eval "$(ssh-agent -s)" and then ssh-add ~/.ssh/id_rsa to add to ssh-agent

type cd ~/.ssh/ and then cat id_rsa, copy the output message, starts with —-start OPENSSh… and end with —-end OPENSSH …

open github => account settings=> GPG and SSH keys => new SSH key

Name the key “main” and paste the key in the textbox below. Click save.

Use ssh -T git@github.com and type yes if you see a warning. If you see Hi! …. shell access. You are ok!

Connecting with https(not reccommanded)

1. Go to github => account settings => developer tools => personal access token => and generate new token, copy the code and store it in a SECURE place. When you connect later as we learn, you have to use this code EVERY TIME. Which, is not reccommanded over SSH as you just need a passphrase.

And you are done! Get ready to put your hands on git next class!

Comment here

back