ADVERTISEMENT
Google AdSense Slot (headerLeaderboard)
Set your Publisher ID in src/config/ads.ts to display live ads.
Git Version Control Tutorial• 6 min read
Git Introduction & The Three Trees Architecture
Repositories, Working Directory, Staging Area, and Commit History
Created in 2005 by Linus Torvalds to maintain the Linux kernel, Git is the universal standard for distributed version tracking and collaborative software engineering.
The Three Trees of Git
1Working Directory: The actual sandbox files on your physical disk that you edit in your IDE.
2Staging Area (Index): An intermediate staging buffer where you prepare and curate changes via
git add before committing.3Repository (Commit History): Cryptographically secure snapshots saved permanently via
git commit -m "...".Initializing a Repository and First Commit
# Initialize a new Git repository in current folder
git init
# Check working tree status
git status
# Stage specific files (or stage all with git add .)
git add index.html styles.css
# Commit staged snapshot with descriptive message
git commit -m "feat: initial commit with responsive layout"
# View concise commit history log
git log --onelineThe standard lifecycle: modify files -> stage with git add -> commit with git commit.
Pro Tip
Always write commit messages in the imperative mood (e.g. "feat: add user login" instead of "added user login").
ADVERTISEMENT
Google AdSense Slot (inContentBanner)
Set your Publisher ID in src/config/ads.ts to display live ads.
Test Yourself With Exercise
Which Git command moves modified files from your Working Directory into the Staging Area?