git config
git
इस्तेमाल
git config [--global] <key> [<value>]git की सेटिंग पढ़ता और लिखता है; --global के बिना यह सिर्फ़ इसी repository में जाती है, नए clone को उसका पता नहीं होता।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| --global | write to ~/.gitconfig for every repository |
| --local | write to .git/config, the default |
| --list --show-origin | print every setting and the file it came from |
| --get <key> | print one value |
| --unset <key> | delete one setting |
| -e | open the config file in your editor |
उदाहरण
git config --global user.email "me@example.com"sets the address every future commit is signed with
git config --global init.defaultBranch mainnew repositories start on main instead of master
git config --list --show-originshows which file each setting comes from
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git config क्या करता है?
git की सेटिंग पढ़ता और लिखता है; --global के बिना यह सिर्फ़ इसी repository में जाती है, नए clone को उसका पता नहीं होता।
Q. इसे कैसे लिखें?
git config [--global] <key> [<value>] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 6 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-config