Step 6.5 of 7 - macOS Setup
This guide will walk you through the process of setting up your Mac for coursework at LearningFuze. The steps need to be completed in the order provided. There are some video clips, pictures, and commands in this guide, but be sure to read all instructions thoroughly as you go so you don't accidentally skip a step.
Check System Requirements
First check to make sure that your Mac laptop meets these system requirements.
- Computer* less than 4 years old (depending on how fast it is)
- Intel, M1, or M2 processor
- 8GB RAM minimum, 16GB recommended
- 16GB of free disk space minimum
- macOS version 11 (Big Sur) or later
*A laptop is required for in-person LearningFuze courses.
If your macOS version is older than 11 (Big Sur), please update it now before continuing.
You can verify your version of macOS by following these steps. You can update your version of macOS with the built-in Software Update app.
Install Xcode Command Line Tools
At LearningFuze, you will use Git and GitHub, just like a professional developer. To enable Git on macOS, install the Xcode Command Line Tools. This is done using the Terminal app that comes with macOS.
Open a new Terminal window
- Press command ⌘ + space
- Type Terminal and press Return
- A Terminal window should appear.
You can install the Xcode Command Line Tools by pasting the following command into Terminal and pressing Return.
xcode-select --install
When you are prompted to install command line developer tools, click Install and Agree to the Command Line Tools License Agreement and wait for the installation to complete before moving on. You might see a huge time estimate like 80 hours, but it won't take that long 😆.
- ⚠️ If you receive an error message saying that
command line tools are already installed
, then Git is already enabled on your Mac and you can jump to the next section of this guide. - ⚠️ If installing the command line developer tools fails, try downloading and installing them manually. You can find the latest version of Command Line Tools for Xcode here.
Install Visual Studio Code
At LearningFuze, you will use Visual Studio Code to edit your code.
To download Visual Studio Code, go to https://code.visualstudio.com/download. Make sure to download the Mac Installer.
Once downloaded, run the installer. There are a lot of screens, but just click through the prompts. At the end, ignore launching Visual Studio Code and viewing the release notes by unchecking the boxes.
Generate an SSH Key
After installing Git Bash, you will need to generate an SSH key in order to authenticate yourself with Github.
- Open Terminal
-
In Terminal, paste the following text, replacing the email used with your Github email address
ssh-keygen -t ed25519 -C "your_email@example.com"
-
Press Return to accept the default location.
- Press Return to accept the default passphrase.
- Press Return to accept the default passphrase again.
- Your SSH key pair is now generated.
Add SSH Key to GitHub
Once the setup script has completed successfully, proceed with the following instructions.
Open the Terminal app and paste in the following command, then press Return. When you ran the setup script, a unique key was generated specifically for your Mac.
cat ~/.ssh/id_ed25519.pub
Your SSH public key for GitHub should print, like in the video below.
Sign into your GitHub account and go to https://github.com/settings/keys. Click New SSH key on GitHub. Give the new key a name that will remind you which computer you pasted the key from. Copy-paste your key from Terminal into GitHub and click Add SSH key. If given the option, choose Authentication Key as the Key type.
To confirm that your SSH key was properly added to GitHub, go back to the Terminal app and paste in the following command, then press Return. Because this may be the first time that you are connecting your Mac to GitHub over SSH, you might receive a confirmation message asking you if you want to continue connecting. Type yes
and press Return. After that, you should receive a message confirming that you've successfully authenticated.
ssh git@github.com
Add your name and email address to Git
After your SSH key has been successfully uploaded to GitHub and you have verified that your Mac authenticates successfully, update Git to remember your name and email address. This should be your full name and the email address you used to sign up with GitHub.
Enter the following commands into Terminal to set your name and email address, but use your own name and email address instead of the examples.
git config --global user.name "Joe King"
git config --global user.email "joe@email.org"
You can check for typos with the following command. You may see some other values print, but the most important things to check are your name and email address. You can fix typos by running the above commands again.
git config --global --list
Clone your solutions repository from GitHub
When you signed into the Learning Management System, a new repository was create for you on your GitHub account. If you visit your profile on GitHub and then go to the Repositories tab, you should see it.
The repository will be named xxxx-code-solutions
where the xxxx
is your cohort number. For example, if student was enrolled in our Web-Dev Prep Class for October, 2020, their repository was named prep-1020-code-solutions. Your repository's name will be similar, but slightly different depending on which class you are enrolled in.
Note: If you cannot find your repository on GitHub, stop and notify an instructor via Slack.
Create Directory
Before you clone your repository, we recommend creating a directory that will store all of your various repositories, so you can easily access them. Open Terminal and run the following command. You can replace repos
with whatever you'd like your directory to be called.
mkdir repos
To clone
In this step you are going to download a copy of this repository onto your computer.
- Be signed into your personal GitHub account at https://github.com
- Go to your Repositories page
- Find your code solutions repository and click on it
- Open Terminal
-
Navigate to the directory you created in the previous step.
cd repos
-
Back on your repository page, click the Code button and copy the SSH URL from your repository.
-
In Terminal, run the following command:
git clone <sshUrl>
- Ex:
git clone git@github.com:shawnkost/javascript-prep-0125-code-solutions.git
- Ex:
-
Open the Visual Studio Code app
- Go to the File menu.
- Go to Open Folder...
- Navigate to your
repos
directory and select your repository. - Wait a moment.
- Once it opens, you should see the files in your repository.
Great! If you ran into problems, please contact an instructor via Slack. Otherwise, you have successfully cloned your repository!
Closing and reopening your solutions repository
This section of the guide shows you how to open your solutions back up after you have closed them. Visual Studio Code keeps a history of which repositories, files, and projects you have opened. You can see by following these steps.
- Close Visual Studio Code.
- Reopen Visual Studio Code.
- Go to the File menu.
- Go to Open Recent...
- Choose your recently-closed code solutions repository.
- Wait a moment.
Nice! Your repository should open back up again. This time it should open much faster. Any time you want to return to your solutions repository, you can get to it via File > Open Recent....