Installing Git and Initial Configuration
You'll learn how to install Git on your machine and configure it with your identity so every commit you make is properly attributed to you.
Why This Matters
Git is the industry-standard version control system, but before you can track changes to your data science projects, you need to install it and tell Git who you are. Think of this like setting up your library card before you can check out books—you need to register your identity first.
Installing Git
On Windows: Download the installer from git-scm.com and run it. The default options work well for most users.
On macOS: Open Terminal and type git --version. If Git isn't installed, macOS will prompt you to install Xcode Command Line Tools, which includes Git. Alternatively, use Homebrew: brew install git.
On Linux: Use your package manager:
- Ubuntu/Debian:
sudo apt-get install git - Fedora:
sudo dnf install git
Essential Configuration
After installation, open your terminal or command prompt and configure your identity. These settings attach your name and email to every commit:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
The --global flag means these settings apply to all your Git projects on this computer.
Verify your configuration:
git config --list
You should see your name and email listed.
Optional But Useful Settings
Set your default text editor for commit messages:
git config --global core.editor "code --wait" # for VS Code
Key Takeaway: Installing Git and configuring your user name and email are the first required steps before you can make any commits—these settings ensure every change you track is properly attributed to you in your project's history.