git show
git
इस्तेमाल
git show [<object>|<commit>:<path>]एक commit को उसके संदेश और diff के साथ दिखाता है; <commit>:<path> लिखने पर फ़ाइल का पुराना रूप working copy छेड़े बिना निकल आता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| --stat | file summary instead of the full patch |
| --name-only | list the paths the commit touched |
| -s | message only, no diff |
| <commit>:<path> | print the file as it was in that commit |
| --pretty=fuller | show author and committer dates separately |
उदाहरण
git show HEADthe message and diff of the last commit
git show HEAD~2:src/app.tsprints an old version of a file without touching your copy
git show --stat v1.2.0what the tagged commit changed, file by file
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git show क्या करता है?
एक commit को उसके संदेश और diff के साथ दिखाता है; <commit>:<path> लिखने पर फ़ाइल का पुराना रूप working copy छेड़े बिना निकल आता है।
Q. इसे कैसे लिखें?
git show [<object>|<commit>:<path>] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 5 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-show