mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
add custom command for checking out a GitHub PR branch from a list
parent
d7fe5df589
commit
a1f797f8e3
1 changed files with 20 additions and 0 deletions
|
@ -116,6 +116,26 @@ customCommands:
|
|||
loadingText: "checking out PR"
|
||||
```
|
||||
|
||||
## List and Select GitHub PR for Checkout
|
||||
|
||||
```yml
|
||||
customCommands:
|
||||
- key: "v"
|
||||
context: "localBranches"
|
||||
loadingText: "Checking out GitHub Pull Request..."
|
||||
command: "gh pr checkout {{.Form.PullRequestNumber}}"
|
||||
prompts:
|
||||
- type: "menuFromCommand"
|
||||
title: "Which PR do you want to check out?"
|
||||
key: "PullRequestNumber"
|
||||
command: >-
|
||||
gh pr list --json number,title,headRefName,updatedAt
|
||||
--template '{{`{{range .}}{{printf "#%v: %s - %s (%s)" .number .title .headRefName (timeago .updatedAt)}}{{end}}`}}'
|
||||
filter: '#(?P<number>[0-9]+): (?P<title>.+) - (?P<ref_name>[^ ]+).*'
|
||||
valueFormat: '{{.number}}'
|
||||
labelFormat: '{{"#" | black | bold}}{{.number | white | bold}} {{.title | yellow | bold}}{{" [" | black | bold}}{{.ref_name | green}}{{"]" | black | bold}}'
|
||||
```
|
||||
|
||||
## Opening git mergetool
|
||||
|
||||
```yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue