Git show Command
In this page:
git show [commit_hash]
git show commit_hash:file_name
Last Commit दिखाना
बिना arguments के git show आपकी सबसे हाल की commit के बारे में सब कुछ दिखाता है -- author, date, पूरा message, और exact patch (line-by-line code changes) जो इसने introduce किया -- एक combined view में।
उदाहरण: Showing the Last Commit
git show
एक Specific Commit दिखाना
एक specific commit hash या tag name pass करना, जैसे git show a1b2c3d, आपको अपने project की history में किसी भी point को same तरीके से inspect करने देता है, सिर्फ latest commit नहीं।
उदाहरण: Showing a Specific Commit
git show a1b2c3d
एक Specific Commit पर एक File दिखाना
git show <commit>:<path/to/file> एक file के exact contents print करता है जैसे वे उस specific commit पर existed थे, बिना उस commit को checkout किए या आपकी current branch या working files को बिल्कुल भी disturb किए।
उदाहरण: Showing a File at a Specific Commit
git show a1b2c3d:path/to/file.txt
Output Format Customize करना
अगर आपको सिर्फ इसकी परवाह है कि कौन सी files बदलीं बजाय पूरे line-by-line patch के, git show --stat detailed diff को प्रति file insertion/deletion counts के एक compact summary से swap कर देता है।
उदाहरण: Customizing the Output Format
git show --stat
File Names और Status दिखाना
git show --name-only और भी आगे जाता है, सिर्फ उन filenames को list करते हुए जो उस commit में add, modify, या delete हुईं -- actual changes में जाने से पहले किसी commit के scope पर एक quick glance के लिए उपयोगी।
उदाहरण: Showing File Names and Status
git show --name-only
git showचलाना और working directory changes की उम्मीद करना, जबकि यह एक committed snapshot और उसका diff दिखाता है।- एक hash का सिर्फ इतना छोटा या ambiguous हिस्सा pass करना, ताकि Git एक ambiguous argument report करे।
git show a1b2c3d:file.txtमें colon भूल जाना, ताकि Gitfile.txtको file के contents दिखाने के बजाय एक अलग path माने।
Chapter Quiz — Complete all 18 topics to unlock
0/18 topics done
Complete these topics first:
- Git init Command
- Git New Files
- Git Staging Environment
- Git clone Command
- Git status Command
- Git help Command
- Git add Command
- Git commit Command
- Git tags Command
- Git stash Command
- Git log Command
- Git diff Command
- Git show Command
- Git rm Command
- Git mv Command
- Git restore Command
- Git clean Command
- Git ignore (.gitignore)