mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
Add custom command to push to different remote repositories
parent
595799c972
commit
00dca020a5
1 changed files with 24 additions and 0 deletions
|
@ -12,6 +12,29 @@ customCommands:
|
||||||
loadingText: 'pushing'
|
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
|
## Pushing to a specific remote branch
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
|
@ -24,6 +47,7 @@ customCommands:
|
||||||
title: 'which branch do you want to push to?'
|
title: 'which branch do you want to push to?'
|
||||||
command: "git push origin {{index .PromptResponses 0}}"
|
command: "git push origin {{index .PromptResponses 0}}"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Creating an annotated tag
|
## Creating an annotated tag
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue