mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-27 03:05:39 +01:00
update aliases to default to current branch, fixes #1601
This commit is contained in:
parent
c0868ea1c0
commit
be8e85b71c
1 changed files with 19 additions and 8 deletions
|
|
@ -166,14 +166,25 @@ compdef git-svn-dcommit-push=git
|
||||||
alias gsr='git svn rebase'
|
alias gsr='git svn rebase'
|
||||||
alias gsd='git svn dcommit'
|
alias gsd='git svn dcommit'
|
||||||
# Current branch
|
# Current branch
|
||||||
alias ggpull='git pull origin $(current_branch)'
|
ggl() {
|
||||||
compdef ggpull=git
|
[[ "$#" != 1 ]] && b="$(current_branch)"
|
||||||
alias ggpur='git pull --rebase origin $(current_branch)'
|
git pull origin "${b:=$1}"
|
||||||
compdef ggpur=git
|
}
|
||||||
alias ggpush='git push origin $(current_branch)'
|
compdef _git ggl=git-checkout
|
||||||
compdef ggpush=git
|
ggu() {
|
||||||
alias ggpnp='git pull origin $(current_branch) &&git push origin $(current_branch)'
|
[[ "$#" != 1 ]] && b="$(current_branch)"
|
||||||
compdef ggpnp=git
|
git pull --rebase origin "${b:=$1}"
|
||||||
|
}
|
||||||
|
compdef _git ggu=git-checkout
|
||||||
|
ggp() {
|
||||||
|
[[ "$#" != 1 ]] && b="$(current_branch)"
|
||||||
|
git push origin "${b:=$1}"
|
||||||
|
}
|
||||||
|
compdef _git ggp=git-checkout
|
||||||
|
ggpnp() {
|
||||||
|
ggl "$1" && ggp "$1"
|
||||||
|
}
|
||||||
|
compdef _git ggpnp=git-checkout
|
||||||
# Work In Progress (wip)
|
# Work In Progress (wip)
|
||||||
# These features allow to pause a branch development and switch to another one
|
# These features allow to pause a branch development and switch to another one
|
||||||
# When you want to go back to work, just unwip it
|
# When you want to go back to work, just unwip it
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue