Coding/Learn/git/git introduction and setup
Git & GitHub Complete Course
01.Introduction, Architecture & Configuration
02.Staging Area, atomic Commits & git status
03.Branching, Fast-Forward & 3-Way Merging
04.Stash, Log Visualization & History Inspection
05.Workflows (Git Flow, Trunk-Based) & Semantic Tagging
06.SSH Keys, Remote Repositories & Origin Setup
07.Push, Fetch, Pull & Upstream Tracking Branches
08.Forking, Clones & Open-Source Pull Requests (PRs)
09.GitHub Flow, Branch Protection & GitHub Pages
10.Undoing Changes: git restore & Safe Public git revert
11.Reset: Deep Dive into --soft, --mixed & --hard
12.Commit Amending & Interactive Rebase (git rebase -i)
13.Reflog & Disaster Recovery (Reviving "Lost" Commits)
14.Merge Conflicts Resolution & git rerere
15..gitignore Rules & .gitattributes Cross-Platform Handling
16.Hooks & Automated Quality Assurance (Pre-Commit)
17.Submodules & Large File Storage (Git LFS)
18.GPG Cryptographic Signing & git cherry-pick
19.Advanced Remotes, Garbage Collection (git gc) & Maintenance
20.Capstone: Production Multi-Branch Enterprise Release Pipeline
Course Certificate0%

Complete all lessons to earn

LearnGit Introduction, Architecture & Configuration
1 / 20 0%
Lesson 01 of 20
6 mins read

Git Introduction, Architecture & Configuration

All TracksNext Lesson
In Plain English

Created in 2005 by Linus Torvalds to maintain the Linux kernel, Git is a distributed version control system (DVCS) that tracks snapshot history of entire projects cryptographically via SHA-1/SHA-256 hashes. Learn the 3 project states: Working Directory, Staging Area (Index), and Git Repository (.git).

The Mental Model

"Git is like a high-speed camera for your project: the Working Directory is your live photography stage, the Staging Area is framing the exact shot in your viewfinder, and committing is snapping an immutable photographic snapshot stored in your photo album (.git)."

Deep Dive: How It Works

The 3 Tree Architecture: Working Directory (untracked/modified files) -> Staging Area (staged index) -> Repository (.git commits).

Immutable Snapshots: Git stores complete filesystem snapshots over time, not differential line delta patches.

Cryptographic Integrity: Every commit, tree, and blob is addressed by a deterministic 40-character SHA hash.

Syntax Blueprint

git config --global user.name "Alex Dev"
git config --global user.email "[email protected]"
git init

Set global committer identity and initialize a fresh repository with a .git metadata directory.

PointCore Rules to Remember

Point star
Distributed Model: Every developer has a full, independent local clone with complete offline history.
Point star
Global Identity: user.name and user.email are embedded immutably into every commit author signature.
Point star
Default Branch: Modern Git repositories default to main as the primary root branch (init.defaultBranch main).

Common Beginner Traps & How to Fix Them

Mistake:Forgetting to configure user.email before making your first commit.

Why it happens: Git falls back to system username@localhost, which fails GitHub/GitLab commit attribution.

How to fix: Run git config --global user.email "[email protected]".

Pro Tip: Use git config --list --show-origin to see exactly which config file (system, global, or local repo) defined each setting.

Live Interactive Example

Hit Run Code to see it live
Initialize and Configure Repository
Git 2.45 / CLI
1
2
3
4
5
6
7
8
9
10
Output Console
Click "Run Code" to view the rendered output.
How it works: git init creates the hidden .git metadata database containing object storage and HEAD ref.

Your Turn: Micro Challenge

No pressure! Edit the starter code below and test your solution with instant feedback.

Micro Exercise

Verify Global Git Username

  • PointSet git config --global user.name to "ZenDeveloper".
  • PointPrint the configured user.name with "git config user.name".
1
2
3
4
5
6
7
8
Sandbox Output
Click "Run & Check" to test your solution.

Finished reading and practicing?

Mark this lesson as completed to update your course progress.

All TracksNext Lesson
Overview100 SheetLearnCertificates