git bisect
git
इस्तेमाल
git bisect start <bad> <good>commit की सीमा को आधा-आधा करके पहला ख़राब commit खोजता है; अंत में git bisect reset करना ज़रूरी है, वरना आप detached commit पर ही अटके रह जाते हैं।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| start <bad> <good> | begin, naming a broken and a working commit |
| good | mark the checked-out commit as working |
| bad | mark it as broken |
| skip | this commit cannot be tested |
| run <cmd> | let a command decide by its exit code |
| reset | stop and go back to where you were |
उदाहरण
git bisect start HEAD v1.1.0starts the search between the last release and now
git bisect run npm testfinds the first failing commit with no further input
git bisect resetends the session; skipping this leaves you on a detached commit
उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. git bisect क्या करता है?
commit की सीमा को आधा-आधा करके पहला ख़राब commit खोजता है; अंत में git bisect reset करना ज़रूरी है, वरना आप detached commit पर ही अटके रह जाते हैं।
Q. इसे कैसे लिखें?
git bisect start <bad> <good> — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 6 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।
मिलती-जुलती कमांड
man पेज: man git-bisect