Git Configuration
In this page:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global core.editor "editor_name"
अपना Username Set करना
Git आपको तब तक commit नहीं करने देता जब तक उसे पता न हो कि आप कौन हैं, इसलिए अपनी पहली commit से पहले आप git config --global user.name से globally अपना name set करते हैं, और वह name permanently आपके save किए हर snapshot में bake हो जाता है।
उदाहरण: Setting Your Username
git config --global user.name "Your Name"
अपना Email Set करना
अपने name के साथ, Git हर commit पर आपका email address भी record करता है -- यही वह value है जो cookiescursor.com जैसे platforms आपकी commits को आपके account से match करने के लिए इस्तेमाल करते हैं, इसलिए double-check करना उचित है कि यह वहाँ registered से match करता है।
उदाहरण: Setting Your Email
git config --global user.email "[email protected]"
Default Editor Set करना
जब किसी command को आपको एक message type करने की ज़रूरत हो (जैसे एक interactive commit), Git जो भी text editor आपने configure किया है उसे launch करता है -- Nano beginner-friendly है, Vim एक बार सीखने पर तेज़ है, और अगर आप एक GUI पसंद करें तो VS Code को default set किया जा सकता है।
उदाहरण: Setting the Default Editor
git config --global core.editor "code --wait"
अपनी Configurations List करना
git config --list चलाना Git के इस समय इस्तेमाल कर रहे हर active setting print करता है, साथ में हर एक किस config file से आई इसके साथ, जो यह debug करने का सबसे तेज़ तरीका है कि जब behavior आपकी उम्मीद से match न हो तो 'Git ऐसा क्यों कर रहा है'।
उदाहरण: Listing Your Configurations
git config --list
Configurations का Scope
Git configuration तीन scopes में layered है: --system machine पर हर user पर apply होता है, --global सिर्फ आपके user account पर apply होता है, और --local सिर्फ current repository के अंदर apply होता है -- conflict होने पर local settings global वालों को override करती हैं।
उदाहरण: Scope of Configurations
git config --system --list
git config --global --list
git config --local --list
git config --global user.nameऔरuser.emailskip करना, ताकि commits गलत या guessed identity दिखाएँ या Git commit करने से मना कर दे।--globalछोड़ देना ताकि setting सिर्फ एक repository पर apply हो और अगली repository फिर पूछे।- अपने GitHub account email से अलग एक email इस्तेमाल करना, ताकि commits आपकी profile से link न हों।
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: