Lab 01: Terminal and git
You’ll open a terminal on your own computer, install git if you don’t already have it, and check that git runs. Every later lab starts with you typing commands into this terminal.
Before you start
- Read Getting started and Terminal and git.
- You need permission to install software on this computer.
Time: about 15 minutes, or less if git is already installed.
Part 1: Open a terminal
Open the terminal app for your OS:
OS App How to open it macOS Terminal Press Cmd+Space, typeTerminal, press EnterWindows Windows Terminal (or PowerShell) Press the Windows key, type Terminal(orPowerShell), press EnterLinux Varies by Linux distribution (distro), for example GNOME Terminal or Konsole Press the Super (Windows) key, type Terminal, press EnterClick inside the window, so that what you type goes to the terminal and not to some other app.
Whenever a step in a lab says “Run:”, type or paste the command shown under it into the terminal, then press Enter.
You should see a window with a prompt, which often ends in $ or >, waiting for you to type.
Part 2: Install git
Follow the steps for your OS, and skip the other two.
macOS
Run:
git --versionIf it prints a version number, git is already installed and you can skip to Finishing.
If git isn’t installed yet, macOS instead offers to install the Xcode Command Line Tools, which include git. Accept the offer and wait for the install to finish.
Run
git --versionagain.
Windows
Download and run the installer from git-scm.com.
The installer’s default options are fine for this course, so accept them as you go through it.
Close any terminal you already had open, and open a new Windows Terminal or PowerShell window. A terminal that was already open during the install won’t find git, so you need a new one.
Run:
git --version
Linux
Run:
sudo apt update && sudo apt install -y git git --versionsudoasks for your password. Nothing appears on screen while you type it, which is normal, so type it anyway and press Enter. If your distro doesn’t useapt, use its own package manager instead, for examplednfon Fedora orpacmanon Arch.
On every OS, you should see git --version print a version number, in a line like git version 2.34.1. Your number may be different, and some systems add more text after it. If you see command not found instead (on Windows, 'git' is not recognized...), see Troubleshooting.
Finishing
You’re done when git --version, run in a terminal on your own computer, prints a version number rather than command not found.
Submit
Nothing to submit.
Next on the Course path: read Why a containerized toolchain and What Docker needs, then do Lab 02: Install Docker.