Youtube link: Navigation to pefrom lab
This lab has three parts:
Part1: Create a github account
- Go to github.com
- Incase you have existing github account please use or sign up for a new account
- If you choose to sign up for a new account, click ‘Sign up’ at the top right
- Create a username. You might need to use a personal email address
- You will need to check your email and verify that your email address is real
Part2: creating repo on github
Create a private repository in your GitHub account called “gittraining”
a. Name: repo-lab
b. Choose ‘Public’
c. Do not initialize with a README
d. Click the green ‘Create Repository’ button
Copy the SSH URL under ‘Quick Setup’
On your remote putty: in the my-repo directory:
# Below are the example, please change the command as per your git repo git branch -M main git remote add origin git@github.com:amitopenwriteup/gittraining.git git push -u origin main #This should fail
Part 3: Configuring SSH Connections to GitHub
To fix this, we need to follow these four steps:
a. Create an SSH key pair
b. Add the PUBLIC key to GitHub
c. GitHub will use the PUBLIC key that you uploaded to GitHub in step ‘B’ to
decrypt the communication from the PRIVATE key from your workstation,
AUTHENTICATING you as an authorized user
ssh-keygen -t rsa -b 4096
#Press enter, no passphrase
Your identification has been saved in /root/.ssh/id_rsa [Private key]
Your public key has been saved in /root/.ssh/id_rsa.pub [Public key]
cat /root/.ssh/id_rsa.pub #copy the value
Now go to github.com
Go to: Settings -> SSH & GPG keys -> SSH Keys
Click ‘New SSH key’
Title “Public repo-key”
Add keys
Now try to push it
git push origin main