Add custom command to push to different remote repositories

David Chocholatý 2022-08-12 12:37:42 +00:00
parent 595799c972
commit 00dca020a5

@ -12,6 +12,29 @@ customCommands:
loadingText: 'pushing'
```
## Pushing to a specific remote repository
This custom command allows picking between already used remote repositories and pushing with force and/or with lease.
```yml
- key: '<c-P>'
description: "Push to a specific remote repository"
context: 'global'
loadingText: 'Pushing ...'
prompts:
- type: 'menuFromCommand'
title: 'Which remote repository to push to?'
command: bash -c "git remote --verbose | grep '/.* (push)'"
filter: '(?P<remote>.*)\s+(?P<url>.*) \(push\)'
valueFormat: '{{ .remote }}'
labelFormat: '{{ .remote | bold | cyan }} {{ .url }}'
- type: 'menu'
title: 'How to push?'
options:
- value: 'push'
- value: 'push --force-with-lease'
- value: 'push --force'
```
## Pushing to a specific remote branch
```yml
@ -24,6 +47,7 @@ customCommands:
title: 'which branch do you want to push to?'
command: "git push origin {{index .PromptResponses 0}}"
```
## Creating an annotated tag
```yml