mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
Updated Custom Commands Compendium (markdown)
parent
603ddedad7
commit
b0ea5fe09a
1 changed files with 12 additions and 0 deletions
|
@ -249,4 +249,16 @@ customCommands:
|
|||
context: files
|
||||
description: tig file (history of commits affecting file)
|
||||
subprocess: yes
|
||||
```
|
||||
|
||||
## Extract diff into index
|
||||
|
||||
This requires some explanation: say you've got a PR that has merged in master a few times and so it's a bit of a mess to follow the changes, but there's actually not that many lines changed in total. In that case, you probably just want to take the actual changes and put them in a single commit on top of the head of the master branch.
|
||||
|
||||
```yml
|
||||
customCommands:
|
||||
- key: 'D'
|
||||
command: git diff {{.SelectedLocalBranch.Name}} > /tmp/lazygit.patch && git reset --hard {{.SelectedLocalBranch.Name}} && git apply /tmp/lazygit.patch
|
||||
context: localBranches
|
||||
description: Extract diff into index
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue