mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-08-09 23:07:56 +02:00
feat(git)!: add force-if-includes
flag (#11481)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com> Closes #11388 BREAKING CHANGE: `gpf` and `gpsupf` now have the `--force-if-includes` flag if git version is greater than 2.30. It will make force pushes more safer. See https://stackoverflow.com/questions/65837109/when-should-i-use-git-push-force-if-includes
This commit is contained in:
@ -199,7 +199,9 @@ alias ggpush='git push origin "$(git_current_branch)"'
|
||||
|
||||
alias ggsup='git branch --set-upstream-to=origin/$(git_current_branch)'
|
||||
alias gpsup='git push --set-upstream origin $(git_current_branch)'
|
||||
alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease'
|
||||
is-at-least 2.30 "$git_version" \
|
||||
&& alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease --force-if-includes' \
|
||||
|| alias gpsupf='git push --set-upstream origin $(git_current_branch) --force-with-lease'
|
||||
|
||||
alias ghh='git help'
|
||||
|
||||
@ -235,7 +237,9 @@ alias gma='git merge --abort'
|
||||
|
||||
alias gp='git push'
|
||||
alias gpd='git push --dry-run'
|
||||
alias gpf='git push --force-with-lease'
|
||||
is-at-least 2.30 "$git_version" \
|
||||
&& alias gpf='git push --force-with-lease --force-if-includes' \
|
||||
|| alias gpf='git push --force-with-lease'
|
||||
alias gpf!='git push --force'
|
||||
alias gpoat='git push origin --all && git push origin --tags'
|
||||
alias gpr='git pull --rebase'
|
||||
|
Reference in New Issue
Block a user