2 min read
Getting Started with Git
This guide covers everything from installation and basic concepts to managing your user configuration at different levels.
Installation & Setup
Download Git
You can download Git for any Operating System (Windows, macOS, Linux) from the official website: 🔗 git-scm.com/install
Verify Installation
After installing, open your Terminal or Command Prompt and run the following command to ensure Git is ready:
git --versionUser Configuration
Git requires an identity (email and username) to be attached to every Commit you make. You can set this at two different levels:
Global Configuration (system-wide)
This sets a default identity for all projects on your computer.
git config --global user.email "example@gmail.com"
git config --global user.name "username"Local Configuration (repository Level)
Use this if you want to use a different identity for a specific repository (e.g., using a work email for a specific folder). Note: You must run these commands inside that specific project folder.
git config --local user.email "example@gmail.com"
git config --local user.name "username"Check Your Settings
To verify your current configuration, use:
# To see all settings
git config --list
# To see a specific setting
git config user.emailCore Concepts
Working Directory
When you start a project with Git, your folder is called the Working Directory. At this point, Git is aware of the files but hasn't "saved" them into its history yet.
Snapshots & Commits
-
Snapshot: Instead of saving a full copy of your project every time, Git takes a "Snapshot" of your files. It only saves the new changes made in every file across all snapshots, making it very efficient.
-
Commit: When you want to save a snapshot of your work, it is called a Commit. This acts as a permanent record in your project's history.
"Git doesn't just save files; it saves the history of your progress." 💻✨
Comments
Loading the discussion…