Skip to content

Commit a33f83c

Browse files
authored
Show pull requests against branches (#2781)
- **PR Description** If the user has `gh` installed and is logged in (`gh auth login`), lazygit shows GitHub PR icons next to the names of branches that have an associated PR, colored by the PR's status (green=open, red=closed, purple=merged). Selecting a branch and pressing `shift-G` opens the PR in the browser.
2 parents eb351dc + 6c8110f commit a33f83c

Some content is hidden

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

63 files changed

+2648
-878
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ If you press `shift+w` on a commit (or branch/ref) a menu will open that allows
228228

229229
![diff_commits](../assets/demo/diff_commits-compressed.gif)
230230

231+
### Show GitHub pull requests
232+
233+
In the branches panel, lazygit can show which of your branches have an associated GitHub pull request by showing a GitHub icon next to the branch name; its color shows the state of the PR (open, merged, etc.). For those that have one, you can press `shift-G` to open the PR in the browser. There is no configuration needed to enable this, but it requires the [`gh`](https://cli.github.com/) tool to be installed, and you need to do `gh auth login` once to allow lazygit to access GitHub.
234+
231235
## Tutorials
232236

233237
[<img src="https://i.imgur.com/sVEktDn.png">](https://youtu.be/CPLdltN7wgE)

docs-master/Config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ keybinding:
707707
branches:
708708
createPullRequest: o
709709
viewPullRequestOptions: O
710+
openPullRequestInBrowser: G
710711
copyPullRequestURL: <c-y>
711712
checkoutBranchByName: c
712713
forceCheckoutBranch: F
@@ -749,6 +750,7 @@ keybinding:
749750
copyCommitAttributeToClipboard: "y"
750751
openLogMenu: <c-l>
751752
openInBrowser: o
753+
openPullRequestInBrowser: G
752754
viewBisectOptions: b
753755
startInteractiveRebase: i
754756
selectCommitsOfCurrentBranch: '*'

docs-master/keybindings/Keybindings_en.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
107107
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
108108
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
109109
| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
110+
| `` G `` | Open pull request in browser | |
110111
| `` <space> `` | Checkout | Checkout the selected commit as a detached HEAD. |
111112
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
112113
| `` o `` | Open commit in browser | |
@@ -180,6 +181,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
180181
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
181182
| `` o `` | Create pull request | |
182183
| `` O `` | View create pull request options | |
184+
| `` G `` | Open pull request in browser | |
183185
| `` <c-y> `` | Copy pull request URL to clipboard | |
184186
| `` c `` | Checkout by name | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
185187
| `` - `` | Checkout previous branch | |

docs-master/keybindings/Keybindings_ja.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ _凡例:`<c-b>` はctrl+b、`<a-b>` はalt+b、`B` はshift+bを意味
8787
| `` t `` | リバート | 選択したコミットの変更を逆に適用する、リバートコミットを作成します。 |
8888
| `` T `` | コミットにタグを付ける | 選択したコミットを指すタグを新規作成します。タグ名とオプションの説明を入力するよう促されます。 |
8989
| `` <c-l> `` | ログオプションを表示 | コミットログのオプションを表示します(例:並び順の変更、Gitグラフの非表示、Gitグラフ全体の表示)。 |
90+
| `` G `` | Open pull request in browser | |
9091
| `` <space> `` | チェックアウト(ブランチの切り替え) | 選択したコミットをデタッチドヘッド(特定のブランチに属さない状態)としてチェックアウトします。 |
9192
| `` y `` | コミット属性をクリップボードにコピー | コミット属性をクリップボードにコピーします(例:ハッシュ、URL、差分、メッセージ、作者)。 |
9293
| `` o `` | ブラウザでコミットを開く | |
@@ -379,6 +380,7 @@ _凡例:`<c-b>` はctrl+b、`<a-b>` はalt+b、`B` はshift+bを意味
379380
| `` N `` | コミットを新しいブランチに移動 | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
380381
| `` o `` | プルリクエストを作成 | |
381382
| `` O `` | プルリクエスト作成オプションを表示 | |
383+
| `` G `` | Open pull request in browser | |
382384
| `` <c-y> `` | プルリクエストURLをクリップボードにコピー | |
383385
| `` c `` | 名前でチェックアウト | 名前でチェックアウトします。入力ボックスに「-」を入力すると、最後のブランチをチェックアウトすることができます。 |
384386
| `` - `` | 直前のブランチにチェックアウト | |

docs-master/keybindings/Keybindings_ko.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
215215
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
216216
| `` o `` | 풀 리퀘스트 생성 | |
217217
| `` O `` | 풀 리퀘스트 생성 옵션 | |
218+
| `` G `` | Open pull request in browser | |
218219
| `` <c-y> `` | 풀 리퀘스트 URL을 클립보드에 복사 | |
219220
| `` c `` | 이름으로 체크아웃 | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
220221
| `` - `` | Checkout previous branch | |
@@ -318,6 +319,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
318319
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
319320
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
320321
| `` <c-l> `` | 로그 메뉴 열기 | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
322+
| `` G `` | Open pull request in browser | |
321323
| `` <space> `` | 체크아웃 | Checkout the selected commit as a detached HEAD. |
322324
| `` y `` | 커밋 attribute 복사 | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
323325
| `` o `` | 브라우저에서 커밋 열기 | |

docs-master/keybindings/Keybindings_nl.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
105105
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
106106
| `` o `` | Maak een pull-request | |
107107
| `` O `` | Bekijk opties voor pull-aanvraag | |
108+
| `` G `` | Open pull request in browser | |
108109
| `` <c-y> `` | Kopieer de URL van het pull-verzoek naar het klembord | |
109110
| `` c `` | Uitchecken bij naam | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
110111
| `` - `` | Checkout previous branch | |
@@ -178,6 +179,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
178179
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
179180
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
180181
| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
182+
| `` G `` | Open pull request in browser | |
181183
| `` <space> `` | Uitchecken | Checkout the selected commit as a detached HEAD. |
182184
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
183185
| `` o `` | Open commit in browser | |

docs-master/keybindings/Keybindings_pl.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
8080
| `` t `` | Cofnij | Utwórz commit cofający dla wybranego commita, który stosuje zmiany wybranego commita w odwrotnej kolejności. |
8181
| `` T `` | Otaguj commit | Utwórz nowy tag wskazujący na wybrany commit. Zostaniesz poproszony o wprowadzenie nazwy tagu i opcjonalnego opisu. |
8282
| `` <c-l> `` | Zobacz opcje logów | Zobacz opcje dla logów commitów, np. zmiana kolejności sortowania, ukrywanie grafu gita, pokazywanie całego grafu gita. |
83+
| `` G `` | Open pull request in browser | |
8384
| `` <space> `` | Przełącz | Przełącz wybrany commit jako odłączoną HEAD. |
8485
| `` y `` | Kopiuj atrybut commita do schowka | Kopiuj atrybut commita do schowka (np. hash, URL, różnice, wiadomość, autor). |
8586
| `` o `` | Otwórz commit w przeglądarce | |
@@ -146,6 +147,7 @@ _Legenda: `<c-b>` oznacza ctrl+b, `<a-b>` oznacza alt+b, `B` oznacza shift+b_
146147
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
147148
| `` o `` | Utwórz żądanie ściągnięcia | |
148149
| `` O `` | Zobacz opcje tworzenia pull requesta | |
150+
| `` G `` | Open pull request in browser | |
149151
| `` <c-y> `` | Kopiuj adres URL żądania ściągnięcia do schowka | |
150152
| `` c `` | Przełącz według nazwy | Przełącz według nazwy. W polu wprowadzania możesz wpisać '-' aby przełączyć się na ostatnią gałąź. |
151153
| `` - `` | Checkout previous branch | |

docs-master/keybindings/Keybindings_pt.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
9797
| `` N `` | Mover commits para uma nova branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
9898
| `` o `` | Create pull request | |
9999
| `` O `` | View create pull request options | |
100+
| `` G `` | Open pull request in browser | |
100101
| `` <c-y> `` | Copiar URL do pull request para área de transferência | |
101102
| `` c `` | Checar por nome | Checar por nome. Na caixa de entrada você pode inserir '-' para trocar para a última branch |
102103
| `` - `` | Checkout da branch anterior | |
@@ -182,6 +183,7 @@ _Legend: `<c-b>` means ctrl+b, `<a-b>` means alt+b, `B` means shift+b_
182183
| `` t `` | Reverter | Crie um commit reverter para o commit selecionado, que aplica as alterações do commit selecionado em reverso. |
183184
| `` T `` | Tag commit | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
184185
| `` <c-l> `` | View log options | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
186+
| `` G `` | Open pull request in browser | |
185187
| `` <space> `` | Verificar | Checkout the selected commit as a detached HEAD. |
186188
| `` y `` | Copy commit attribute to clipboard | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
187189
| `` o `` | Open commit in browser | |

docs-master/keybindings/Keybindings_ru.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ _Связки клавиш_
189189
| `` t `` | Revert | Create a revert commit for the selected commit, which applies the selected commit's changes in reverse. |
190190
| `` T `` | Пометить коммит тегом | Create a new tag pointing at the selected commit. You'll be prompted to enter a tag name and optional description. |
191191
| `` <c-l> `` | Открыть меню журнала | View options for commit log e.g. changing sort order, hiding the git graph, showing the whole git graph. |
192+
| `` G `` | Open pull request in browser | |
192193
| `` <space> `` | Переключить | Checkout the selected commit as a detached HEAD. |
193194
| `` y `` | Скопировать атрибут коммита | Copy commit attribute to clipboard (e.g. hash, URL, diff, message, author). |
194195
| `` o `` | Открыть коммит в браузере | |
@@ -214,6 +215,7 @@ _Связки клавиш_
214215
| `` N `` | Move commits to new branch | Create a new branch and move the unpushed commits of the current branch to it. Useful if you meant to start new work and forgot to create a new branch first.<br><br>Note that this disregards the selection, the new branch is always created either from the main branch or stacked on top of the current branch (you get to choose which). |
215216
| `` o `` | Создать запрос на принятие изменений | |
216217
| `` O `` | Создать параметры запроса принятие изменений | |
218+
| `` G `` | Open pull request in browser | |
217219
| `` <c-y> `` | Скопировать URL запроса на принятие изменений в буфер обмена | |
218220
| `` c `` | Переключить по названию | Checkout by name. In the input box you can enter '-' to switch to the previous branch. |
219221
| `` - `` | Checkout previous branch | |

docs-master/keybindings/Keybindings_zh-CN.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
144144
| `` t `` | 撤销(Revert) | 为所选提交创建还原提交,这会反向应用所选提交的更改。 |
145145
| `` T `` | 标签提交 | 创建一个新标签指向所选提交。您可以在弹窗中输入标签名称和描述(可选)。 |
146146
| `` <c-l> `` | 打开日志菜单 | 查看提交日志的选项,例如更改排序顺序、隐藏 git graph、显示整个 git graph。 |
147+
| `` G `` | Open pull request in browser | |
147148
| `` <space> `` | 检出 | 检出所选择的提交作为分离HEAD。 |
148149
| `` y `` | 复制提交属性到剪贴板 | 复制提交属性到剪贴板(如hash、URL、diff、消息、作者)。 |
149150
| `` o `` | 在浏览器中打开提交 | |
@@ -229,6 +230,7 @@ _图例:`<c-b>` 意味着ctrl+b, `<a-b>意味着Alt+b, `B` 意味着shift+b_
229230
| `` N `` | 移动提交至新分支 | 创建一个新分支,并将当前分支未推送的提交移动到该分支。如果您打算开始新工作但忘记先创建新分支,这会很有用。<br><br>请注意,此操作忽略选择,新分支总是从主分支创建或堆叠在当前分支之上(您可以选择哪种方式)。 |
230231
| `` o `` | 创建拉取请求 | |
231232
| `` O `` | 创建拉取请求选项 | |
233+
| `` G `` | Open pull request in browser | |
232234
| `` <c-y> `` | 复制拉取请求 URL 到剪贴板 | |
233235
| `` c `` | 按名称检出 | 按名称检出。在输入框中,您可以输入'-' 来切换到最后一个分支。 |
234236
| `` - `` | 签出上一个分支 | |

0 commit comments

Comments
 (0)