This lesson covers the basic command line tricks we'll need to do lessons on Rails Academy.
If you don't understand all the commands, don't worry! We'll be using them a lot in the future, so you'll get plenty of practice.
- Bash
- GitHub
- SSH Keys
- GitHub CLI (gh)
Visit GitHub and create a free account or log in if you already have one.
Open Alacritty and run the following command:
ssh-keygen -t ed25519
- Press Enter multiple times to accept to all the defaults
- Do not enter a passphrase when prompted
pbcopy < ~/.ssh/id_ed25519.pub
cat ~/.ssh/id_ed25519.pub
Copy the text that is outputted.
- In GitHub, navigate to Settings > SSH and GPG keys > New SSH Key
- Paste your public key into the “Key” field
- Select a title for the key like "Rails Academy Key"
- Click "Add SSH Key"
ssh -T [email protected]
Expected output:
Hi yourgithubusername! You've successfully authenticated, but GitHub does not provide shell access.
First, let's make sure we are in the right folder.
cd ~/lessons/ra-101
Then we'll need to:
- Visit Skool and copy your “Skool ID” from your profile
- Create a branch with your Skool username with the command below:
git branch @my-skool-username
git checkout @my-skool-username
Your terminal prompt should now show:
~/lessons/ra-101 [@my-skool-username]
$ _
This means git is currently on the @skool-username
branch.
echo "@my-skool-username" > skool.txt
git add skool.txt
git commit -m "Added skool.txt with my Skool ID"
Lets double check the log, to make sure the commit was successful:
git log
Your should see something like:
commit 1234567890abcdef1234567890abcdef12345678 (HEAD -> @my-skool-username)
Author: yourgithubusername <yourgithubemail>
Date: Mon Jan 1 00:00:00 2021 -0500
Added skool.txt with my Skool ID
- Authenticate with GitHub CLI:
gh auth login
- Select GitHub.com > HTTPS > Login with web browser.
- Create the PR:
gh pr create
- Press Enter multiple times to accept the defaults
- Select Submit
- You should get a link to your PR, it should look like this:
https://github.com/yourusername/ra-101/pull/1
- Visit your PR on Github.
The automatic check will run if your code passes, you'll see:
✅ All checks have passed
Once accepted its time to move onto the next lesson.