Git Introduction
In this page:
Git क्या है?
Git एक free, open-source distributed version control system है जो छोटी scripts से लेकर Linux kernel जैसे massive codebases तक हर चीज़ speed और efficiency के साथ handle करने के लिए बना है। यह समय के साथ आपकी files में किए गए हर change track करता है, ताकि developers की एक team एक-दूसरे का काम overwrite किए बिना parallel में same codebase पर काम कर सके।
उदाहरण: What is Git?
git init
git add file.txt
git commit -m "Track file.txt in Git"
Version Control क्यों इस्तेमाल करें?
Version control आपको आगे बढ़ते हुए अपने project के numbered snapshots save करने देता है, ताकि एक bad edit कभी permanent न हो -- आप हमेशा एक known-good state पर वापस roll back कर सकते हैं। safety से आगे, यह collaboration की backbone है: cookiescursor.com जैसे platforms इसका इस्तेमाल कई contributors को एक shared history में काम merge करने देने के लिए करते हैं।
उदाहरण: Why Use Version Control?
git log --oneline
git checkout <commit-hash> -- file.txt
Centralized बनाम Distributed VCS
Centralized systems (पुराने-style SVN जैसे) को सिर्फ history देखने या commit करने के लिए एक central server से live connection चाहिए। Git इसके बजाय distributed है: हर clone पूरी project history locally रखता है, इसलिए आप पूरी तरह offline commit, branch, और logs inspect कर सकते हैं, फिर जब भी आपके पास connection हो दूसरों के साथ sync कर सकते हैं।
उदाहरण: Centralized vs. Distributed VCS
git clone https://github.com/user/repo.git
cd repo
git log
Key Terminology
चार terms Git की ज़्यादातर vocabulary carry करते हैं: एक Repository tracked project folder है, एक Commit यह describe करने वाले एक message के साथ एक saved snapshot है कि क्या बदला, एक Branch development की एक independent line है जिस पर आप safely experiment कर सकते हैं, और HEAD बस एक pointer है जो भी commit या branch आपने इस समय checked out किया है उसकी ओर।
उदाहरण: Key Terminology
git init myrepo
git commit -m "Initial commit"
git branch feature-login
अपना Setup Verify करना
अपनी पहली repository बनाने से पहले, यह confirm करना उचित है कि आपका terminal actually Git से बात कर सकता है -- एक simple version-check command चलाना verify करता है कि executable installed है और आपके system PATH में है, आपको बाद में एक real command के चुपचाप fail होने पर एक confusing error से बचाते हुए।
उदाहरण: Verifying Your Setup
git --version
- Git को GitHub से confuse करना, जबकि Git आपके computer पर version control tool है और GitHub Git repositories के लिए एक hosting service है।
- यह सोचना कि Git सिर्फ internet connection के साथ काम करता है, जबकि यह distributed है और commits,
git logऔर branching सब offline काम करते हैं। - Git को पूरी disk का एक backup मानना, जबकि यह सिर्फ उन files में changes record करता है जिन्हें आपने stage और commit किया है।
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: