mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge remote branch 'upstream/master'
This commit is contained in:
commit
a55b0025c3
25 changed files with 267 additions and 21 deletions
34
plugins/git/git.plugin.zsh
Normal file
34
plugins/git/git.plugin.zsh
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Aliases
|
||||
alias g='git'
|
||||
alias ga='git add'
|
||||
alias gs='git status'
|
||||
alias gl='git pull'
|
||||
alias gup='git fetch && git rebase'
|
||||
alias gp='git push'
|
||||
alias gd='git diff | less'
|
||||
alias gdv='git diff -w "$@" | vim -R -'
|
||||
alias gc='git commit -v'
|
||||
alias gca='git commit -v -a'
|
||||
alias gb='git branch'
|
||||
alias gba='git branch -a'
|
||||
alias gcount='git shortlog -sn'
|
||||
alias gcp='git cherry-pick'
|
||||
alias gsub='git submodule'
|
||||
|
||||
|
||||
# Git and svn mix
|
||||
alias git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk'
|
||||
|
||||
#
|
||||
# Will return the current branch name
|
||||
# Usage example: git pull origin $(current_branch)
|
||||
#
|
||||
function current_branch() {
|
||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
||||
echo ${ref#refs/heads/}
|
||||
}
|
||||
|
||||
# these aliases take advangate of the previous function
|
||||
alias ggpull='git pull origin $(current_branch)'
|
||||
alias ggpush='git push origin $(current_branch)'
|
||||
alias ggpnp='git pull origin $(current_branch) && git push origin $(current_branch)'
|
||||
Loading…
Add table
Add a link
Reference in a new issue