2 min read
Getting Started with Git: From Zero to Your First Commit
A simplified guide to understanding how Git works, how to install it, and how to start tracking your projects.
Core Concepts
When working with Git, your files go through a specific journey. Here is an explanation of the terms you mentioned in a structured technical way:
Working Directory
When you start a new project and initialize Git, this folder is called the Working Directory. At this stage, Git sees the files but doesn't take any action on them (they are in an untracked state) unless you explicitly tell it to.
Snapshot
In Git, we don't just save random full copies of the folder. Instead, we take Snapshots.
-
The Snapshot: This is a record of the state of all project files at a specific point in time.
-
Instead of saving the entire file every time, Git is smart enough to save only the new changes in every snapshot. This makes Git fast and space-efficient.
Commit
A Commit is the actual process of saving a snapshot into your project's history.
Simple Analogy: Imagine you are playing a video game and you reach a certain level and "Save" your progress. That "Save" is exactly what a Commit is in the world of programming.
Installing Git
Step 1: Download
You can download Git for any Operating System (Windows, macOS, Linux) from the official website: 🔗 Click here to download Git
Step 2: Verify Installation
After downloading and installing, open your Terminal or Command Prompt and type the following command to ensure everything is working correctly:
git --versionThe Git Lifecycle
-
Modify: You edit your files in the Working Directory.
-
Stage: You select the specific changes you want to include in the next snapshot (using
git add). -
Commit: You permanently save the snapshot to the Git database (using
git commit).
"Git doesn't just save files; it saves the history of your ideas." 💻✨
Comments
Loading the discussion…