git ls-files

git

इस्तेमाल

git ls-files [-o|-m|-i] [--exclude-standard]

डिस्क की जगह index में दर्ज पथ सूचीबद्ध करता है, इसलिए script के लिए यही भरोसेमंद सूची है; -i अकेले नहीं चलता, उसके साथ -c या -o और --exclude-standard चाहिए।

आम विकल्प

विकल्पअर्थ
-cfiles in the index; the default
-mtracked files modified on disk
-dtracked files that are missing
-ofiles git does not track
-iignored files; must come with -o or -c and --exclude-standard
--exclude-standardapply .gitignore and friends
-sshow mode and object id of each entry
-zseparate paths with NUL for xargs -0

उदाहरण

git ls-files

every tracked path, straight from the index

git ls-files -o --exclude-standard

untracked files only, respecting .gitignore

git ls-files -i -c --exclude-standard

tracked files that .gitignore says should be ignored

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

कैसे पढ़ें

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

आम सवाल

Q. git ls-files क्या करता है?

डिस्क की जगह index में दर्ज पथ सूचीबद्ध करता है, इसलिए script के लिए यही भरोसेमंद सूची है; -i अकेले नहीं चलता, उसके साथ -c या -o और --exclude-standard चाहिए।

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

git ls-files [-o|-m|-i] [--exclude-standard] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

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

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

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

man पेज: man git-ls-files