0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

feat(git): gtc - push new tag automatically to remote

This commit is contained in:
Joran Van Belle 2024-07-17 16:08:08 +02:00
parent 7d3a702b15
commit d3e580eaad
2 changed files with 4 additions and 3 deletions

View file

@ -205,7 +205,7 @@ plugins=(... git)
| `gta` | `git tag --annotate` | | `gta` | `git tag --annotate` |
| `gts` | `git tag -s` | | `gts` | `git tag -s` |
| `gtv` | `git tag \| sort -V` | | `gtv` | `git tag \| sort -V` |
| `gtc` | `git tag -a <tagName> -m <message/tagName>` | | `gtc` | `git tag -a <tagName> -m <message/tagName> && git push origin <tagName>` |
| `gignore` | `git update-index --assume-unchanged` | | `gignore` | `git update-index --assume-unchanged` |
| `gunignore` | `git update-index --no-assume-unchanged` | | `gunignore` | `git update-index --no-assume-unchanged` |
| `gwch` | `git whatchanged -p --abbrev-commit --pretty=medium` | | `gwch` | `git whatchanged -p --abbrev-commit --pretty=medium` |

View file

@ -327,11 +327,12 @@ function ggp() {
} }
compdef _git ggp=git-checkout compdef _git ggp=git-checkout
function git_tag_add() { function git_tag_create() {
local tagName=$1 local tagName=$1
local message=${2:-$tagName} local message=${2:-$tagName}
git tag -a "$tagName" -m "$message" git tag -a "$tagName" -m "$message"
git push origin $tagName
} }
alias gpu='git push upstream' alias gpu='git push upstream'
@ -398,7 +399,7 @@ alias gswm='git switch $(git_main_branch)'
alias gta='git tag --annotate' alias gta='git tag --annotate'
alias gts='git tag --sign' alias gts='git tag --sign'
alias gtv='git tag | sort -V' alias gtv='git tag | sort -V'
alias gtc='git_tag_add' alias gtc='git_tag_create'
alias gignore='git update-index --assume-unchanged' alias gignore='git update-index --assume-unchanged'
alias gunignore='git update-index --no-assume-unchanged' alias gunignore='git update-index --no-assume-unchanged'
alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium'