git fsck
git
इस्तेमाल
git fsck [--lost-found] [--unreachable]object database की जाँच करता है और उन commit को गिनाता है जिन्हें कोई नहीं दिखाता — reflog मिट जाने के बाद reset से खोया काम खोजने का दूसरा रास्ता; यह बताता है, ठीक नहीं करता।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| --lost-found | write dangling objects into .git/lost-found |
| --unreachable | list objects no ref points at |
| --dangling | list objects nothing at all refers to |
| --full | check packs and alternates too |
| --connectivity-only | skip the expensive object checks |
| --no-reflogs | do not treat reflog entries as roots |
उदाहरण
git fsck --lost-foundrecovers commits after a reset when the reflog is gone
git fsck --unreachablelists commits nothing points at any more
git fsck --connectivity-onlya 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