git sparse-checkout

git

इस्तेमाल

git sparse-checkout set <dir>...

git 2.25 में जुड़ा यह आदेश बड़े repository में सिर्फ़ बताए गए फ़ोल्डर डिस्क पर रखता है; इतिहास पूरा ही रहता है और cone mode glob नहीं, फ़ोल्डर के नाम लेता है।

आम विकल्प

विकल्पअर्थ
set <dir>...check out only these directories
add <dir>add another directory to the set
listshow the current set
disablego back to a full checkout
reapplyapply the set again after a merge or pull
--no-coneuse raw gitignore-style patterns instead of directories

उदाहरण

git sparse-checkout set apps/web packages/ui

leaves the rest of the monorepo off your disk

git sparse-checkout list

shows which directories are present

git sparse-checkout disable

restores every file

उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. git sparse-checkout क्या करता है?

git 2.25 में जुड़ा यह आदेश बड़े repository में सिर्फ़ बताए गए फ़ोल्डर डिस्क पर रखता है; इतिहास पूरा ही रहता है और cone mode glob नहीं, फ़ोल्डर के नाम लेता है।

Q. इसे कैसे लिखें?

git sparse-checkout set <dir>... — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 6 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।

मिलती-जुलती कमांड

man पेज: man git-sparse-checkout