
यह कोर्स आपको modern development की सबसे ज़रूरी skill सिखाता है—version control। इसमें आप Git के core commands, real-world GitHub workflow (branches, pull requests, reviews) और open-source contribution की basic understanding पाएँगे। 1–2 हफ्तों में fast, practical और industry-ready skill build करने पर फोकस है। 🚀
इस chapter में हम Git को real developer की तरह use करना सीखेंगे। यहाँ focus है mistakes से safely recover करना, clean history maintain करना और daily production workflow (जैसे UdaanPath) को smooth बनाना।
कभी-कभी आप किसी feature पर काम कर रहे होते हैं और अचानक
किसी urgent bug पर switch करना पड़ता है।
उस समय git stash lifesaver होता है।
git stash git switch main
वापस अपने काम पर आने के लिए:
git stash pop
UdaanPath Example:
Git course chapter लिखते समय live site bug आया —
आप work stash करके bug fix branch पर चले गए।
अगर file में किया गया change पसंद नहीं आया और commit नहीं किया, तो safely revert किया जा सकता है।
git restore course.html
Stage से file हटाने के लिए:
git restore --staged course.html
git reset powerful है — लेकिन careless use dangerous हो सकता है।
git reset --soft HEAD~1
Rule: Public branch (main) पर --hard avoid करें।
अगर commit message गलत हो गया या small file miss हो गई, तो नया commit बनाने की जरूरत नहीं।
git commit --amend
UdaanPath Example:
Commit लिखा “Update course” — amend करके clear message बना दिया।
Rebase commits को straight line में arrange करता है, जिससे history clean और readable रहती है।
Before Rebase:
A---B---C (main)
\
D---E (feature)
After Rebase:
A---B---C---D---E
git rebase main
Rule: Rebase केवल local / private branches पर करें।
Multiple small commits को एक meaningful commit में convert करना squash कहलाता है।
git rebase -i HEAD~3
Open-source और PR merge से पहले squash best practice है।
Tags project ke important versions mark करने के लिए होते हैं।
git tag v1.0 git push origin v1.0
UdaanPath Example:
Git course v1.0 officially released।
git cherry-pickअगले chapter में हम Git को real project में apply करेंगे — Mini Project + Team Simulation।