← Back to Git Course | Chapter 1: Introduction & Setup | Lesson 1 of 7

Git Introduction

Git आपके project के लिए एक save-game system जैसा है: यह हर version याद रखता है, ताकि आप किसी पहले वाले पर वापस jump कर सकें या देख सकें कि किसने क्या बदला। कई लोग एक-दूसरे का काम मिटाए बिना साथ काम कर सकते हैं।

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?

bash
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?

bash
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

bash
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

bash
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

bash
git --version
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. Git को GitHub से confuse करना, जबकि Git आपके computer पर version control tool है और GitHub Git repositories के लिए एक hosting service है।
  2. यह सोचना कि Git सिर्फ internet connection के साथ काम करता है, जबकि यह distributed है और commits, git log और branching सब offline काम करते हैं।
  3. Git को पूरी disk का एक backup मानना, जबकि यह सिर्फ उन files में changes record करता है जिन्हें आपने stage और commit किया है।
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.