DevOps : Git Installation & 10 Real Projects
From Installation to DevOps Workflow: Zero to Hero Guide
1. Git Installation (Setup Your Machine)
For Linux (Ubuntu):
For Windows:
Go to git-scm.com, download the installer and click “Next” (default settings are perfect for DevOps).
Verify Installation:
2. Git Configuration (Identity Setup)
Git ko batana padega ki code kaun likh raha hai. Bina iske aap “Commit” nahi kar payenge.
git config –global user.email “sumit@example.com”
👉 Real DevOps Tip: Hamesha wahi email use karein jo aapke GitHub/GitLab account ka hai, taaki aapke “Contributions” sahi se dikhein.
🚀 10 Real-Time Hands-on Projects
Project 1: Initialize First Git Project
Scenario: Naya project shuru karna hai (DevOps Website).
git init # Initialize local repository
touch index.html
git add index.html # Add to Staging
git commit -m “First commit: Initial website setup”
Project 2: Track Multiple Files
Scenario: Aapne CSS aur JS files bhi add kar di hain.
git add . # ‘.’ means add EVERYTHING in current folder
git commit -m “Added design and logic files”
Project 3: Modify File & Track Changes
Scenario: Developer ne index.html badal diya.
git diff # Dekho kya badla hai
git add index.html && git commit -m “Updated homepage content”
Project 4: Undo Mistake Before Commit
Scenario: Galti se ek galat file `secret.txt` stage ho gayi.
Yahan beginner sabse zyada galti karte hain, reset se file delete nahi hoti, bas staging area se bahar aati hai.
Project 5: Fix Last Commit (Amend)
Scenario: Commit message mein typo ho gaya ya koi file miss ho gayi.
Project 6: Restore Deleted File
Scenario: Oh no! Galti se `index.html` delete ho gaya (rm index.html).
Project 7: Full History Audit
Scenario: Manager ne pucha- “Pichle 3 commits mein kya hua tha?”
Project 8-10 Summary
Simulating Sync, Multi-folder setup, and Manual Recovery using git checkout and git status to maintain 100% code integrity.
⚠️ Mistakes That Kill Productivity
Solution: Hamesha pehle
git add karein.
Solution: Real DevOps me hamesha meaningful message likhein: “Fix: Resolved login button alignment”.
Solution: Use
.gitignore to exclude large files.
Summary: Now You Are a Git Practitioner! 🎯
Aapne seekha: Install kaise karein, Identity kaise banayein, aur 10 real scenarios mein Git ko kaise handle karein.