Updated Custom Commands Compendium (markdown)

Jesse Duffield 2022-05-31 22:36:37 +10:00
parent 603ddedad7
commit b0ea5fe09a

@ -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
```