diff options
Diffstat (limited to 'plugins/git/git.plugin.zsh')
-rw-r--r-- | plugins/git/git.plugin.zsh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 9f7819df3..4b5ddf44c 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -7,6 +7,8 @@ alias gd='git diff' compdef _git gd=git-diff alias gdc='git diff --cached' compdef _git gdc=git-diff +alias gdt='git diff-tree --no-commit-id --name-only -r' +compdef _git gdc=git diff-tree --no-commit-id --name-only -r alias gl='git pull' compdef _git gl=git-pull alias gup='git pull --rebase' @@ -51,6 +53,7 @@ alias gb='git branch' compdef _git gb=git-branch alias gba='git branch -a' compdef _git gba=git-branch +alias gbr='git branch --remote' alias gcount='git shortlog -sn' compdef gcount=git alias gcl='git config --list' @@ -70,6 +73,7 @@ alias gss='git status -s' compdef _git gss=git-status alias ga='git add' compdef _git ga=git-add +alias gap='git add --patch' alias gm='git merge' compdef _git gm=git-merge alias grh='git reset HEAD' @@ -77,6 +81,18 @@ alias grhh='git reset HEAD --hard' alias gclean='git reset --hard && git clean -dfx' alias gwc='git whatchanged -p --abbrev-commit --pretty=medium' +# Sign and verify commits with GPG +alias gcs='git commit -S' +compdef _git gcs=git-commit +alias gsps='git show --pretty=short --show-signature' +compdef _git gsps=git-show + +# Sign and verify tags with GPG +alias gts='git tag -s' +compdef _git gts=git-tag +alias gvt='git verify-tag' +compdef _git gvt=git verify-tag + #remove the gf alias #alias gf='git ls-files | grep' @@ -108,12 +124,14 @@ alias gsd='git svn dcommit' # Usage example: git pull origin $(current_branch) # function current_branch() { + if [ ! -d .git ]; then return; fi ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo ${ref#refs/heads/} } function current_repository() { + if [ ! -d .git ]; then return; fi ref=$(git symbolic-ref HEAD 2> /dev/null) || \ ref=$(git rev-parse --short HEAD 2> /dev/null) || return echo $(git remote -v | cut -d':' -f 2) |