git init --bare
git
इस्तेमाल
git init --bare [--shared=group] <directory>.gitबिना working tree वाला repository बनाता है, जो सिर्फ़ push लेने के लिए होता है; उसमें फ़ाइलें संपादित नहीं होतीं, पर checked-out branch की वजह से कोई push रुकता भी नहीं।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| --bare | no working tree; only the contents of .git |
| --shared=group | let one unix group push into it |
| -b <name> | name the first branch |
| --template=<dir> | seed it with hooks from a template directory |
उदाहरण
git init --bare /srv/git/app.gitcreates a repository to push into over ssh
git init --bare --shared=group team.gita shared repository a unix group can all write to
git init --bare ~/backup/app.gita push target on a backup disk
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git init --bare क्या करता है?
बिना working tree वाला repository बनाता है, जो सिर्फ़ push लेने के लिए होता है; उसमें फ़ाइलें संपादित नहीं होतीं, पर checked-out branch की वजह से कोई push रुकता भी नहीं।
Q. इसे कैसे लिखें?
git init --bare [--shared=group] <directory>.git — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 4 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-init---bare