Skip to content

Commit

Permalink
Merge pull request ohmyzsh#985 from pomaxa/master
Browse files Browse the repository at this point in the history
git plugin function
  • Loading branch information
robbyrussell committed Jun 13, 2012
2 parents f60244f + b1e4ef1 commit b84d336
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/git/git.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,16 @@ function current_branch() {
echo ${ref#refs/heads/}
}

function current_repository() {

ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo $(git remote -v | cut -d':' -f 2)
}

# these aliases take advantage of the previous function
alias ggpull='git pull origin $(current_branch)'
compdef ggpull=git
alias ggpush='git push origin $(current_branch)'
compdef ggpush=git
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
compdef ggpnp=git
compdef ggpnp=git

0 comments on commit b84d336

Please sign in to comment.