git log
git
इस्तेमाल
git log [--oneline] [--graph] [<range>] [-- <path>]commit इतिहास नए से पुराने क्रम में दिखाता है, पर सिर्फ़ मौजूदा HEAD के पूर्वज; बाकी branch देखने के लिए --all चाहिए।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| --oneline | one short line per commit |
| --graph | draw the branch lines |
| --all | include every branch, not just the current one |
| -p | show the patch of each commit |
| --stat | show which files changed |
| -n <n> | stop after n commits |
| --since=<date> | commits newer than a date, e.g. "2 weeks ago" |
| --follow | keep following one file through renames |
उदाहरण
git log --oneline --graph --allthe whole history as a compact graph
git log -p -- src/app.tsevery change ever made to one file
git log --since="2 weeks ago" --author=jaderecent commits by one person
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git log क्या करता है?
commit इतिहास नए से पुराने क्रम में दिखाता है, पर सिर्फ़ मौजूदा HEAD के पूर्वज; बाकी branch देखने के लिए --all चाहिए।
Q. इसे कैसे लिखें?
git log [--oneline] [--graph] [<range>] [-- <path>] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 8 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-log