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
goodmark the checked-out commit as working
badmark it as broken
skipthis commit cannot be tested
run <cmd>let a command decide by its exit code
resetstop and go back to where you were

उदाहरण

git bisect start HEAD v1.1.0

starts the search between the last release and now

git bisect run npm test

finds the first failing commit with no further input

git bisect reset

ends 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