git fsck

git

इस्तेमाल

git fsck [--lost-found] [--unreachable]

object database की जाँच करता है और उन commit को गिनाता है जिन्हें कोई नहीं दिखाता — reflog मिट जाने के बाद reset से खोया काम खोजने का दूसरा रास्ता; यह बताता है, ठीक नहीं करता।

आम विकल्प

विकल्पअर्थ
--lost-foundwrite dangling objects into .git/lost-found
--unreachablelist objects no ref points at
--danglinglist objects nothing at all refers to
--fullcheck packs and alternates too
--connectivity-onlyskip the expensive object checks
--no-reflogsdo not treat reflog entries as roots

उदाहरण

git fsck --lost-found

recovers commits after a reset when the reflog is gone

git fsck --unreachable

lists commits nothing points at any more

git fsck --connectivity-only

a quick structural check on a huge repository

उलझन यह है कि पीछे लौटने के कई रूप हैं — ब्रांच का इशारा हटाना और उलटने वाला कमिट जोड़ना एक बात नहीं।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. git fsck क्या करता है?

object database की जाँच करता है और उन commit को गिनाता है जिन्हें कोई नहीं दिखाता — reflog मिट जाने के बाद reset से खोया काम खोजने का दूसरा रास्ता; यह बताता है, ठीक नहीं करता।

Q. इसे कैसे लिखें?

git fsck [--lost-found] [--unreachable] — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 6 दिए हैं; पूरी सूची man git में है। यह कमांड git में आती है।

मिलती-जुलती कमांड

man पेज: man git-fsck