lazygit चीटशीट
0.44lazygit keyboard shortcuts के साथ git को pro की तरह navigate करें
हिन्दी: 2026-03-29
अगर आप आज पंद्रहवीं बार git log --oneline --graph --decorate --all type कर चुके हैं, तो lazygit आपका नया सबसे अच्छा दोस्त बनने वाला है। यह git के लिए एक terminal UI है जो git commands के फैले हुए जाल को एक keyboard-driven interface में बदल देता है जहाँ staging, committing, rebasing, और conflicts resolve करना कुछ ही keystrokes में होता है। इसे raw git CLI और full-blown GUI के बीच का middle ground समझें — आपको terminal छोड़े बिना visual feedback मिलता है।
Mental model सीधा है: lazygit panels (Status, Files, Branches, Commits, Stash) में organized है, और आप number keys या Tab से उनके बीच switch करते हैं। हर panel के अंदर, j/k से navigate करें (या arrow keys अगर वह आपकी style है), और selected item पर actions perform करने के लिए keys press करें। ज़्यादातर actions single keystrokes हैं — कोई colons नहीं, कोई prefixes नहीं, कोई :wq-style commands नहीं। Context मायने रखता है: Files panel में d press करने से changes discard होते हैं, लेकिन Stash panel में यह stash entry drop करता है।
lazygit सीखने का सबसे अच्छा तरीका है कि बस इसे किसी repo में खोलें और चीज़ें press करना शुरू करें। ? key आपका safety net है — यह current panel के लिए हर available shortcut दिखाता है। यह cheatsheet उन shortcuts को cover करती है जो आप रोज़ाना इस्तेमाल करेंगे और कुछ power-user moves जो आपको सोचने पर मजबूर करेंगे कि इनके बिना कैसे काम चलता था। यहाँ सब कुछ default keybindings पर based है; अगर आपने config customize किया है, तो results भिन्न हो सकते हैं।
Tips
Files panel में किसी file पर Enter press करें और line-by-line staging mode में जाएँ। यह lazygit का killer feature है — आप सिर्फ whole hunks नहीं, individual lines stage कर सकते हैं। एक साथ कई lines stage करने के लिए range select toggle करने के लिए v इस्तेमाल करें।
z से लगभग कुछ भी undo करें। lazygit hood के नीचे reflog इस्तेमाल करता है, तो dropped commits और बुरे rebases भी reverse किए जा सकते हैं। यह infinite नहीं है, लेकिन "अरे नहीं" वाले moments cover करता है।
~/.config/lazygit/config.yml में custom commands define कर सकते हैं। उदाहरण के लिए, git log --all --oneline --graph या project-specific deploy script को key से bind करें। Custom commands input के लिए prompt कर सकते हैं, चलाने से पहले confirm कर सकते हैं, और panel में output भी दिखा सकते हैं।
lazygit छोड़े बिना कोई भी arbitrary shell command चलाने के लिए : key इस्तेमाल करें। git bisect start जैसे one-off operations या किसी specific commit पर test suite चलाने के लिए बढ़िया है।
Merge conflicts resolve करते समय, lazygit conflicting sections highlight करता है और आपको एक ही keypress से incoming या current change चुनने देता है। [ और ] से conflicts navigate करें, फिर Space से side चुनें। Conflict markers हाथ से edit करने से कहीं कम error-prone।
Files panel में v press करके range select mode में enter करके files bulk-select कर सकते हैं। Selection extend करने के लिए j/k से move करें, फिर Space press करके सब कुछ एक साथ stage करें।
अगर multiple repos के साथ काम करते हैं, तो recent repositories picker खोलने के लिए Ctrl+r press करें। lazygit याद रखता है आप कहाँ गए थे, तो context switch करना instant है।