Objective. Students install Git on a Linux or Windows workstation, configure global user identity and preferred editor, and verify the installation produces a functional git version output.
This lesson, its worked examples and its practice questions has not yet been verified by an industry-certified professional or by a certification or approval body. It is a study draft and may contain errors. Do not use it as instructions for work on a job site or on live equipment. Always follow your instructor, your supervising professional, and current official references and regulations.
VoTechWorks program approval and accreditation are still in progress. Credentials are issued only by the certifying bodies named in each program, after their own exams.
Before you write a single line of production code, your environment must be configured correctly. Git is the industry-standard distributed version control system used across virtually every software development workplace. Installing it properly and configuring your identity ensures that every commit you record is traceable, recoverable, and ready for team collaboration.
Most Linux distributions ship Git through their native package managers. Open a terminal with sufficient privileges and run the appropriate command for your distribution:
The package manager resolves dependencies automatically and places the Git binaries in your system PATH. After the installation completes, confirm it succeeded:
```
git --version
```
The terminal should return a version string such as `git version 2.x.x`. Record this exact string in your lab log. If the command is not found, the installation did not complete successfully — re-read the output for error messages before continuing.
Download the official installer from git-scm.com. During setup, accept the recommended defaults unless your instructor specifies otherwise. The installer adds Git Bash, a POSIX-compatible terminal, along with the core Git tools. After installation, open Git Bash or PowerShell and run `git --version` to verify.
Every commit in Git is stamped with the author's name and email address. This is not optional — without it, some Git workflows refuse to commit. Set your identity globally so it applies to every repository on your workstation:
```
git config --global user.name "Your Full Name"
git config --global user.email "you@example.com"
```
Use the same email address you will register with GitHub so that commits link correctly to your profile.
Git opens a text editor whenever you write a commit message or resolve a conflict interactively. Set your preferred editor now:
```
git config --global core.editor nano
```
Replace `nano` with `vim`, `code --wait` (Visual Studio Code), or another editor you are comfortable with. The `--wait` flag tells VS Code to pause Git until you close the file.
Modern Git repositories use `main` as the default branch name. Configure this before you create any repositories:
```
git config --global init.defaultBranch main
```
Display all active settings with:
```
git config --list
```
You should see `user.name`, `user.email`, `core.editor`, and `init.defaultBranch` in the output. Copy this output into your lab log and have it signed off by your instructor.
Git stores global settings in a plain text file at `~/.gitconfig` on Linux/macOS and in your user profile folder on Windows. You can read this file directly to inspect or manually edit settings.
Passwords for remote repositories are increasingly deprecated. SSH key-pair authentication is the standard secure method for communicating with GitHub.
Run the following command in your terminal:
```
ssh-keygen -t ed25519 -C "you@example.com"
```
The `-t ed25519` flag selects a modern, compact elliptic-curve algorithm. When prompted for a file location, press Enter to accept the default (`~/.ssh/id_ed25519`). When prompted for a passphrase, entering one adds an extra layer of protection — this is strongly recommended on shared or lab workstations.
Two files are created: `id_ed25519` (your private key, never shared) and `id_ed25519.pub` (your public key, safe to share).
1. Display the public key: `cat ~/.ssh/id_ed25519.pub`
2. Copy the entire output.
3. In your GitHub account, go to Settings → SSH and GPG keys → New SSH key.
4. Paste the public key, give it a descriptive title, and save.
```
ssh -T git@github.com
```
A successful response reads: Hi username! You've successfully authenticated, but GitHub does not provide shell access. Log this message verbatim. If authentication fails, check that the correct public key was added and that your SSH agent has loaded the private key (`ssh-add ~/.ssh/id_ed25519`).
Answer each question, then check it. Nothing is recorded; this is your own practice.
A free tech program — complimentary, as our commitment to get America working. Help us build VoTechWorks. Tell us what works, what doesn’t, and what you want to learn.