lazygit चीटशीट

0.44

lazygit 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 भिन्न हो सकते हैं।

Navigation Basics
1-5
Status / Files / Branches / Commits / Stash panel पर jump करें
Tab
अगले panel पर cycle करें
Shift+Tab
पिछले panel पर cycle करें
jk
Current list में नीचे / ऊपर जाएँ
Ctrl+d
Main view नीचे scroll करें (half page)
Ctrl+u
Main view ऊपर scroll करें (half page)
?
Current panel के keybindings दिखाएँ
Esc
Cancel / वापस जाएँ / popup बंद करें
q
lazygit quit करें
[]
Side panel tabs के बीच switch करें (जैसे Local / Remote / Tags)
{}
Diff view बाएँ / दाएँ scroll करें
x
सभी available actions का menu खोलें
Staging
Space
Selected file stage / unstage करें
a
सभी files stage या unstage करें
Enter
Individual hunks / lines stage करने के लिए file खोलें
Space
Selected hunk stage / unstage करें (staging view में)
a
पूरी file stage / unstage करें (staging view में)
Tab
Staged और unstaged changes के बीच switch करें (staging view में)
e
File editor में खोलें
d
Selected file में changes discard करें (सावधान!)
D
Discard options menu खोलें (discard all, clean, आदि)
i
File को .gitignore में add करें
Commits
c
Staged changes commit करें (message input खुलता है)
C
Git editor के साथ commit करें (multiline messages के लिए)
A
Staged changes के साथ last commit amend करें
r
Selected commit message reword करें
s
Selected commit को ऊपर वाले में squash करें
f
Fixup — commit को parent में squash करें, उसका message discard करें
d
Selected commit drop (delete) करें
t
Selected commit tag करें
g
Selected commit पर reset करें (soft/mixed/hard menu खुलता है)
y
Commit SHA clipboard पर copy करें
o
Commit browser में खोलें
Enter
Commit files और diff देखें
Branching
Space
Selected branch checkout करें
n
Current HEAD से नई branch बनाएँ
d
Selected branch delete करें
r
Current branch को selected branch पर rebase करें
M
Selected branch को current branch में merge करें
R
Selected branch rename करें
c
नाम से branch checkout करें (search)
f
Selected branch force checkout करें
Enter
Branch commits देखें
u
Selected branch के लिए upstream set / unset करें
w
Worktree options खोलें
Stash
s
सभी changes stash करें (Files panel से)
S
Stash options खोलें (staged only, keep index, आदि)
Space
Selected stash entry apply करें
g
Selected stash entry pop करें (apply + drop)
d
Selected stash entry drop करें
Enter
Stash entry contents देखें
r
Stash entry rename करें
Remote Operations
f
सभी remotes fetch करें
p
Remote से pull करें
P
Remote पर push करें
shift+P
Push options खोलें (force push, set upstream, आदि)
u
Upstream branch set करें
Interactive Rebase
e
Selected commit से interactive rebase शुरू करें (edit mode)
Ctrl+j
Rebase के दौरान selected commit नीचे ले जाएँ
Ctrl+k
Rebase के दौरान selected commit ऊपर ले जाएँ
s
Commit को squash के लिए mark करें
f
Commit को fixup के लिए mark करें
d
Commit को drop के लिए mark करें
e
Commit को edit के लिए mark करें (यहाँ rebase pause करें)
p
Commit को pick के लिए mark करें (as-is रखें)
m
Rebase जारी रखें / अगले step पर जाएँ
Esc
Interactive rebase abort करें
z
आखिरी action undo करें (reflog के ज़रिए)
Custom Commands और Extras
:
Custom command prompt खोलें (कोई भी shell command चलाएँ)
+
Recent repos list खोलें
@
Command log panel खोलें
/
Current panel में filter / search करें
Ctrl+r
Recent repository पर switch करें
W
Diff menu खोलें (branches/commits compare करें)
Ctrl+o
File name / path clipboard पर copy करें
.
नीचे command log दिखाएँ/छुपाएँ

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 है।

Related Tools