What Git is and why it matters
Git is the most widely used version control system (VCS) in the world. A version control system tracks changes to files over time. Instead of maintaining multiple files like resume, resumev2, and resumev4, Git lets you keep one file while preserving its full history—every previous version and every change you've made.
Git is not the same as GitHub. Git is the version control tool that runs locally on your computer, while GitHub is a cloud platform for storing code and collaborating with others. They work together to support building, scaling, and securing software.
Core concepts
Before running commands, it helps to understand the areas Git moves your work through:
- Working directory: where you make changes to files. This is the current state of your project that Git hasn't been told to track yet.
- Staging area: also called the index, this is where you prepare changes before committing them. It's a draft space for reviewing and adjusting before the changes enter project history.
- Local repository: your project's history stored on your computer, including all commits and branches.
- Remote repository: a version of your project hosted on the internet or network, enabling collaboration through pushes and pulls.
- Branches: parallel versions of your project for working on features or fixes independently, without affecting the main project until you merge them back.
- Pull request: a proposal to merge changes from one branch into another, often used for review and discussion in team collaboration.
- Merge: the process of integrating changes from one branch into another, combining their histories into one.
Installing Git
On macOS
macOS ships with a preinstalled Git version, but you'll still want to download the latest from git-scm.com/downloads to stay current.
- Go to git-scm.com/downloads and click macOS.
- Install Homebrew by copying the command
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)", pasting it into your terminal, and pressing enter. This will take a few moments to run. - Once Homebrew is installed, run
brew install gitin your terminal. This installs Git on your system. - Run the command
gitin your terminal—you should see a list of all available commands.
On Windows 11
Click the Windows icon on the download page for the most recent Git version. Once the installer folder is on your machine, double-click it and follow the wizard:
- Click "Next" to accept the terms, choose the location, and keep the default selections.
- Set the default branch name to "main," as that's the current convention.
- Click "Next" to accept the recommended path, the bundled OpenSSH program, and all other options.
- Click "Install," then click "Finish" and open your terminal.
- Run the command
git—you should see a list of all available commands.
Configuring Git
After installation, set your identity so Git knows who made changes:
- In your terminal, run
git config --global user.name "FIRST_NAME LAST_NAME"andgit config --global user.email "[email protected]". This gives you credit for your work. - Run
git configto see other available configuration options—these aren't needed right now. - Check who Git thinks you are with
git config --list, which returns the options you just set. - Press Q to exit the screen.
First commands: setup and basic workflow
Once configured, create a practice project and move some files through Git's workflow:
Create a folder and file
- Run
mkdir git-practiceto create a new folder, thencd git-practiceto move into it. - Open the folder in your code editor.
- Run
touch hello.mdto create a Markdown file in the folder. - You'll see the
hello.mdfile in your code editor.
Initialize a repository
- Run
git initin the folder. This is the first command for a new project—it lets Git start tracking your changes. - Run
git statusand you'll see Git is tracking the emptyhello.md. This command shows your changes, whether they're staged, and which files Git tracks.
Stage changes
- Run
git add .followed bygit status. The trackedhello.mdfile will appear in a different color, indicating it's staged. - In your code editor, type:
#I'm learning to use Git! - Save the file and run
git statusin your terminal—it will show that a change has been made tohello.md.
Commit changes
- Run
git commit -m 'initial commit'to save your changes with an attached message.
You'll use git status, git add, and git commit constantly while working with Git. Run git in your terminal for a full list of commands, or see GitHub's command reference for usage details.
Practice resources
To build your skills further, explore these resources:



