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

Git Installation और Setup

Git install करना अपने device पर एक नया app डालने और इसे बताने जैसा है कि आप कौन हैं। आप इसे एक बार download करते हैं और फिर यह किसी भी project के लिए ready है।

Windows पर Install करना

Windows पर, git-scm.com से official installer download करें; यह Git Bash bundle करता है, एक Unix-style terminal emulator, इसलिए आपको वही command syntax मिलता है जो हर Git tutorial में और macOS या Linux पर developers इस्तेमाल करते हैं।

उदाहरण: Installing on Windows

bash
winget install --id Git.Git -e --source winget

macOS पर Install करना

macOS पर, Git आमतौर पर एक अलग installer के बजाय Xcode Command Line Tools के through आता है -- Terminal खोलें, कोई भी git command चलाएँ, और अगर वे missing हों तो macOS automatically tools install करने के लिए prompt करेगा।

उदाहरण: Installing on macOS

bash
xcode-select --install

Linux पर Install करना

Linux पर, Git आपके distribution के package manager से आता है, इसलिए exact command आपके flavor पर depend करती है: Debian/Ubuntu पर apt install git, Red Hat/CentOS/Fedora पर yum install git (या dnf)।

उदाहरण: Installing on Linux

bash
sudo apt install git
sudo yum install git

Git Bash या Terminal खोलना

एक बार installed होने पर, सभी Git commands एक terminal-style interface में type किए जाते हैं -- Windows पर Git Bash, या macOS और Linux पर built-in Terminal app -- क्योंकि Git का खुद default रूप से कोई graphical interface नहीं है।

उदाहरण: Opening Git Bash or Terminal

bash
git help

Initial Verification

install करने के बाद, यह confirm करने के लिए एक quick version check चलाना उचित है कि Git binary आपके terminal से reachable है; अभी एक broken PATH पकड़ना बाद में एक mysterious 'command not found' error debug करने से कहीं कम confusing है।

उदाहरण: Initial Verification

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 install करना और फिर पहले से खुले एक terminal में git चलाना, command not found पाना क्योंकि नया PATH देखने के लिए terminal को restart करना ज़रूरी है।
  2. install करने के बाद git --version से check skip करना, ताकि पहला command fail होने तक एक failed या partial install unnoticed रहे।
  3. एक similar नाम वाला अलग package install करना, जैसे सिर्फ git चाहिए होने पर apt install git-all, कई extra tools खींचते हुए।
🔒

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.