Skip to content

Commit 08f0e28

Browse files
Add worktrees view (#2147)
2 parents 52447e5 + 2d4706e commit 08f0e28

File tree

178 files changed

+58191
-4351
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+58191
-4351
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ test/results/**
3939

4040
oryxBuildBinary
4141
__debug_bin
42+
43+
.worktrees

docs/Config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ os:
323323
editAtLine: 'myeditor --line={{line}} {{filename}}'
324324
editAtLineAndWait: 'myeditor --block --line={{line}} {{filename}}'
325325
editInTerminal: true
326+
openDirInEditor: 'myeditor {{dir}}'
326327
```
327328

328329
The `editInTerminal` option is used to decide whether lazygit needs to suspend

docs/Custom_Command_Keybindings.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The permitted contexts are:
7474
| -------------- | -------------------------------------------------------------------------------------------------------- |
7575
| status | The 'Status' tab |
7676
| files | The 'Files' tab |
77+
| worktrees | The 'Worktrees' tab |
7778
| localBranches | The 'Local Branches' tab |
7879
| remotes | The 'Remotes' tab |
7980
| remoteBranches | The context you get when pressing enter on a remote in the remotes tab |
@@ -300,6 +301,7 @@ SelectedRemote
300301
SelectedTag
301302
SelectedStashEntry
302303
SelectedCommitFile
304+
SelectedWorktree
303305
CheckedOutBranch
304306
```
305307

docs/keybindings/Keybindings_en.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
8989
<kbd>t</kbd>: Revert commit
9090
<kbd>T</kbd>: Tag commit
9191
<kbd>&lt;c-l&gt;</kbd>: Open log menu
92+
<kbd>w</kbd>: View worktree options
9293
<kbd>&lt;space&gt;</kbd>: Checkout commit
9394
<kbd>y</kbd>: Copy commit attribute
9495
<kbd>o</kbd>: Open commit in browser
@@ -154,6 +155,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
154155
<kbd>g</kbd>: View reset options
155156
<kbd>R</kbd>: Rename branch
156157
<kbd>u</kbd>: Set/Unset upstream
158+
<kbd>w</kbd>: View worktree options
157159
<kbd>&lt;enter&gt;</kbd>: View commits
158160
<kbd>/</kbd>: Filter the current view by text
159161
</pre>
@@ -231,6 +233,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
231233

232234
<pre>
233235
<kbd>&lt;c-o&gt;</kbd>: Copy commit SHA to clipboard
236+
<kbd>w</kbd>: View worktree options
234237
<kbd>&lt;space&gt;</kbd>: Checkout commit
235238
<kbd>y</kbd>: Copy commit attribute
236239
<kbd>o</kbd>: Open commit in browser
@@ -254,6 +257,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
254257
<kbd>d</kbd>: Delete branch
255258
<kbd>u</kbd>: Set as upstream of checked-out branch
256259
<kbd>g</kbd>: View reset options
260+
<kbd>w</kbd>: View worktree options
257261
<kbd>&lt;enter&gt;</kbd>: View commits
258262
<kbd>/</kbd>: Filter the current view by text
259263
</pre>
@@ -276,6 +280,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
276280
<kbd>d</kbd>: Drop
277281
<kbd>n</kbd>: New branch
278282
<kbd>r</kbd>: Rename stash
283+
<kbd>w</kbd>: View worktree options
279284
<kbd>&lt;enter&gt;</kbd>: View selected item's files
280285
<kbd>/</kbd>: Filter the current view by text
281286
</pre>
@@ -294,6 +299,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
294299

295300
<pre>
296301
<kbd>&lt;c-o&gt;</kbd>: Copy commit SHA to clipboard
302+
<kbd>w</kbd>: View worktree options
297303
<kbd>&lt;space&gt;</kbd>: Checkout commit
298304
<kbd>y</kbd>: Copy commit attribute
299305
<kbd>o</kbd>: Open commit in browser
@@ -311,6 +317,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
311317
<pre>
312318
<kbd>&lt;c-o&gt;</kbd>: Copy submodule name to clipboard
313319
<kbd>&lt;enter&gt;</kbd>: Enter submodule
320+
<kbd>&lt;space&gt;</kbd>: Enter submodule
314321
<kbd>d</kbd>: Remove submodule
315322
<kbd>u</kbd>: Update submodule
316323
<kbd>n</kbd>: Add new submodule
@@ -328,6 +335,18 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
328335
<kbd>P</kbd>: Push tag
329336
<kbd>n</kbd>: Create tag
330337
<kbd>g</kbd>: View reset options
338+
<kbd>w</kbd>: View worktree options
331339
<kbd>&lt;enter&gt;</kbd>: View commits
332340
<kbd>/</kbd>: Filter the current view by text
333341
</pre>
342+
343+
## Worktrees
344+
345+
<pre>
346+
<kbd>n</kbd>: Create worktree
347+
<kbd>&lt;space&gt;</kbd>: Switch to worktree
348+
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
349+
<kbd>o</kbd>: Open in editor
350+
<kbd>d</kbd>: Remove worktree
351+
<kbd>/</kbd>: Filter the current view by text
352+
</pre>

docs/keybindings/Keybindings_ja.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
5252
<kbd>d</kbd>: Drop
5353
<kbd>n</kbd>: 新しいブランチを作成
5454
<kbd>r</kbd>: Stashを変更
55+
<kbd>w</kbd>: View worktree options
5556
<kbd>&lt;enter&gt;</kbd>: View selected item's files
5657
<kbd>/</kbd>: Filter the current view by text
5758
</pre>
@@ -60,6 +61,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
6061

6162
<pre>
6263
<kbd>&lt;c-o&gt;</kbd>: コミットのSHAをクリップボードにコピー
64+
<kbd>w</kbd>: View worktree options
6365
<kbd>&lt;space&gt;</kbd>: コミットをチェックアウト
6466
<kbd>y</kbd>: コミットの情報をコピー
6567
<kbd>o</kbd>: ブラウザでコミットを開く
@@ -72,6 +74,17 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
7274
<kbd>/</kbd>: 検索を開始
7375
</pre>
7476

77+
## Worktrees
78+
79+
<pre>
80+
<kbd>n</kbd>: Create worktree
81+
<kbd>&lt;space&gt;</kbd>: Switch to worktree
82+
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
83+
<kbd>o</kbd>: Open in editor
84+
<kbd>d</kbd>: Remove worktree
85+
<kbd>/</kbd>: Filter the current view by text
86+
</pre>
87+
7588
## コミット
7689

7790
<pre>
@@ -95,6 +108,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
95108
<kbd>t</kbd>: コミットをrevert
96109
<kbd>T</kbd>: タグを作成
97110
<kbd>&lt;c-l&gt;</kbd>: ログメニューを開く
111+
<kbd>w</kbd>: View worktree options
98112
<kbd>&lt;space&gt;</kbd>: コミットをチェックアウト
99113
<kbd>y</kbd>: コミットの情報をコピー
100114
<kbd>o</kbd>: ブラウザでコミットを開く
@@ -133,6 +147,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
133147
<pre>
134148
<kbd>&lt;c-o&gt;</kbd>: サブモジュール名をクリップボードにコピー
135149
<kbd>&lt;enter&gt;</kbd>: サブモジュールを開く
150+
<kbd>&lt;space&gt;</kbd>: サブモジュールを開く
136151
<kbd>d</kbd>: サブモジュールを削除
137152
<kbd>u</kbd>: サブモジュールを更新
138153
<kbd>n</kbd>: サブモジュールを新規追加
@@ -160,6 +175,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
160175
<kbd>P</kbd>: タグをpush
161176
<kbd>n</kbd>: タグを作成
162177
<kbd>g</kbd>: View reset options
178+
<kbd>w</kbd>: View worktree options
163179
<kbd>&lt;enter&gt;</kbd>: コミットを閲覧
164180
<kbd>/</kbd>: Filter the current view by text
165181
</pre>
@@ -211,6 +227,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
211227
<kbd>g</kbd>: View reset options
212228
<kbd>R</kbd>: ブランチ名を変更
213229
<kbd>u</kbd>: Set/Unset upstream
230+
<kbd>w</kbd>: View worktree options
214231
<kbd>&lt;enter&gt;</kbd>: コミットを閲覧
215232
<kbd>/</kbd>: Filter the current view by text
216233
</pre>
@@ -305,6 +322,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
305322
<kbd>d</kbd>: ブランチを削除
306323
<kbd>u</kbd>: Set as upstream of checked-out branch
307324
<kbd>g</kbd>: View reset options
325+
<kbd>w</kbd>: View worktree options
308326
<kbd>&lt;enter&gt;</kbd>: コミットを閲覧
309327
<kbd>/</kbd>: Filter the current view by text
310328
</pre>
@@ -313,6 +331,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
313331

314332
<pre>
315333
<kbd>&lt;c-o&gt;</kbd>: コミットのSHAをクリップボードにコピー
334+
<kbd>w</kbd>: View worktree options
316335
<kbd>&lt;space&gt;</kbd>: コミットをチェックアウト
317336
<kbd>y</kbd>: コミットの情報をコピー
318337
<kbd>o</kbd>: ブラウザでコミットを開く

docs/keybindings/Keybindings_ko.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
4848

4949
<pre>
5050
<kbd>&lt;c-o&gt;</kbd>: 커밋 SHA를 클립보드에 복사
51+
<kbd>w</kbd>: View worktree options
5152
<kbd>&lt;space&gt;</kbd>: 커밋을 체크아웃
5253
<kbd>y</kbd>: 커밋 attribute 복사
5354
<kbd>o</kbd>: 브라우저에서 커밋 열기
@@ -68,6 +69,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
6869
<kbd>d</kbd>: Drop
6970
<kbd>n</kbd>: 새 브랜치 생성
7071
<kbd>r</kbd>: Rename stash
72+
<kbd>w</kbd>: View worktree options
7173
<kbd>&lt;enter&gt;</kbd>: View selected item's files
7274
<kbd>/</kbd>: Filter the current view by text
7375
</pre>
@@ -76,6 +78,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
7678

7779
<pre>
7880
<kbd>&lt;c-o&gt;</kbd>: 커밋 SHA를 클립보드에 복사
81+
<kbd>w</kbd>: View worktree options
7982
<kbd>&lt;space&gt;</kbd>: 커밋을 체크아웃
8083
<kbd>y</kbd>: 커밋 attribute 복사
8184
<kbd>o</kbd>: 브라우저에서 커밋 열기
@@ -88,6 +91,17 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
8891
<kbd>/</kbd>: 검색 시작
8992
</pre>
9093

94+
## Worktrees
95+
96+
<pre>
97+
<kbd>n</kbd>: Create worktree
98+
<kbd>&lt;space&gt;</kbd>: Switch to worktree
99+
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
100+
<kbd>o</kbd>: Open in editor
101+
<kbd>d</kbd>: Remove worktree
102+
<kbd>/</kbd>: Filter the current view by text
103+
</pre>
104+
91105
## 메뉴
92106

93107
<pre>
@@ -177,6 +191,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
177191
<kbd>g</kbd>: View reset options
178192
<kbd>R</kbd>: 브랜치 이름 변경
179193
<kbd>u</kbd>: Set/Unset upstream
194+
<kbd>w</kbd>: View worktree options
180195
<kbd>&lt;enter&gt;</kbd>: 커밋 보기
181196
<kbd>/</kbd>: Filter the current view by text
182197
</pre>
@@ -196,6 +211,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
196211
<pre>
197212
<kbd>&lt;c-o&gt;</kbd>: 서브모듈 이름을 클립보드에 복사
198213
<kbd>&lt;enter&gt;</kbd>: 서브모듈 열기
214+
<kbd>&lt;space&gt;</kbd>: 서브모듈 열기
199215
<kbd>d</kbd>: 서브모듈 삭제
200216
<kbd>u</kbd>: 서브모듈 업데이트
201217
<kbd>n</kbd>: 새로운 서브모듈 추가
@@ -226,6 +242,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
226242
<kbd>d</kbd>: 브랜치 삭제
227243
<kbd>u</kbd>: Set as upstream of checked-out branch
228244
<kbd>g</kbd>: View reset options
245+
<kbd>w</kbd>: View worktree options
229246
<kbd>&lt;enter&gt;</kbd>: 커밋 보기
230247
<kbd>/</kbd>: Filter the current view by text
231248
</pre>
@@ -253,6 +270,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
253270
<kbd>t</kbd>: 커밋 되돌리기
254271
<kbd>T</kbd>: Tag commit
255272
<kbd>&lt;c-l&gt;</kbd>: 로그 메뉴 열기
273+
<kbd>w</kbd>: View worktree options
256274
<kbd>&lt;space&gt;</kbd>: 커밋을 체크아웃
257275
<kbd>y</kbd>: 커밋 attribute 복사
258276
<kbd>o</kbd>: 브라우저에서 커밋 열기
@@ -294,6 +312,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
294312
<kbd>P</kbd>: 태그를 push
295313
<kbd>n</kbd>: 태그를 생성
296314
<kbd>g</kbd>: View reset options
315+
<kbd>w</kbd>: View worktree options
297316
<kbd>&lt;enter&gt;</kbd>: 커밋 보기
298317
<kbd>/</kbd>: Filter the current view by text
299318
</pre>

docs/keybindings/Keybindings_nl.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
9898
<kbd>g</kbd>: Bekijk reset opties
9999
<kbd>R</kbd>: Hernoem branch
100100
<kbd>u</kbd>: Set/Unset upstream
101+
<kbd>w</kbd>: View worktree options
101102
<kbd>&lt;enter&gt;</kbd>: Bekijk commits
102103
<kbd>/</kbd>: Filter the current view by text
103104
</pre>
@@ -147,6 +148,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
147148
<kbd>t</kbd>: Commit ongedaan maken
148149
<kbd>T</kbd>: Tag commit
149150
<kbd>&lt;c-l&gt;</kbd>: Open log menu
151+
<kbd>w</kbd>: View worktree options
150152
<kbd>&lt;space&gt;</kbd>: Checkout commit
151153
<kbd>y</kbd>: Copy commit attribute
152154
<kbd>o</kbd>: Open commit in browser
@@ -209,6 +211,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
209211

210212
<pre>
211213
<kbd>&lt;c-o&gt;</kbd>: Kopieer commit SHA naar klembord
214+
<kbd>w</kbd>: View worktree options
212215
<kbd>&lt;space&gt;</kbd>: Checkout commit
213216
<kbd>y</kbd>: Copy commit attribute
214217
<kbd>o</kbd>: Open commit in browser
@@ -232,6 +235,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
232235
<kbd>d</kbd>: Verwijder branch
233236
<kbd>u</kbd>: Stel in als upstream van uitgecheckte branch
234237
<kbd>g</kbd>: Bekijk reset opties
238+
<kbd>w</kbd>: View worktree options
235239
<kbd>&lt;enter&gt;</kbd>: Bekijk commits
236240
<kbd>/</kbd>: Filter the current view by text
237241
</pre>
@@ -276,6 +280,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
276280
<kbd>d</kbd>: Laten vallen
277281
<kbd>n</kbd>: Nieuwe branch
278282
<kbd>r</kbd>: Rename stash
283+
<kbd>w</kbd>: View worktree options
279284
<kbd>&lt;enter&gt;</kbd>: Bekijk gecommite bestanden
280285
<kbd>/</kbd>: Filter the current view by text
281286
</pre>
@@ -294,6 +299,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
294299

295300
<pre>
296301
<kbd>&lt;c-o&gt;</kbd>: Kopieer commit SHA naar klembord
302+
<kbd>w</kbd>: View worktree options
297303
<kbd>&lt;space&gt;</kbd>: Checkout commit
298304
<kbd>y</kbd>: Copy commit attribute
299305
<kbd>o</kbd>: Open commit in browser
@@ -311,6 +317,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
311317
<pre>
312318
<kbd>&lt;c-o&gt;</kbd>: Kopieer submodule naam naar klembord
313319
<kbd>&lt;enter&gt;</kbd>: Enter submodule
320+
<kbd>&lt;space&gt;</kbd>: Enter submodule
314321
<kbd>d</kbd>: Remove submodule
315322
<kbd>u</kbd>: Update submodule
316323
<kbd>n</kbd>: Voeg nieuwe submodule toe
@@ -328,6 +335,18 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
328335
<kbd>P</kbd>: Push tag
329336
<kbd>n</kbd>: Creëer tag
330337
<kbd>g</kbd>: Bekijk reset opties
338+
<kbd>w</kbd>: View worktree options
331339
<kbd>&lt;enter&gt;</kbd>: Bekijk commits
332340
<kbd>/</kbd>: Filter the current view by text
333341
</pre>
342+
343+
## Worktrees
344+
345+
<pre>
346+
<kbd>n</kbd>: Create worktree
347+
<kbd>&lt;space&gt;</kbd>: Switch to worktree
348+
<kbd>&lt;enter&gt;</kbd>: Switch to worktree
349+
<kbd>o</kbd>: Open in editor
350+
<kbd>d</kbd>: Remove worktree
351+
<kbd>/</kbd>: Filter the current view by text
352+
</pre>

0 commit comments

Comments
 (0)