git ls-files
git
इस्तेमाल
git ls-files [-o|-m|-i] [--exclude-standard]डिस्क की जगह index में दर्ज पथ सूचीबद्ध करता है, इसलिए script के लिए यही भरोसेमंद सूची है; -i अकेले नहीं चलता, उसके साथ -c या -o और --exclude-standard चाहिए।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -c | files in the index; the default |
| -m | tracked files modified on disk |
| -d | tracked files that are missing |
| -o | files git does not track |
| -i | ignored files; must come with -o or -c and --exclude-standard |
| --exclude-standard | apply .gitignore and friends |
| -s | show mode and object id of each entry |
| -z | separate paths with NUL for xargs -0 |
उदाहरण
git ls-filesevery tracked path, straight from the index
git ls-files -o --exclude-standarduntracked files only, respecting .gitignore
git ls-files -i -c --exclude-standardtracked 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