]> git.rmz.io Git - dotfiles.git/blobdiff - zsh/aliases/git.zsh
nvim: add FPP copyright snippet
[dotfiles.git] / zsh / aliases / git.zsh
index 7eb053a233181b034f5a1dd4d443fc520a5e847e..f46ed9172b5ba989c844eabd40a2915faa9d14f7 100644 (file)
@@ -14,6 +14,8 @@ alias gd='git diff'
 alias gdc='git diff --cached'
 function gdm { gd "${1:-origin}".. }
 compdef _git gdm=git-diff
 alias gdc='git diff --cached'
 function gdm { gd "${1:-origin}".. }
 compdef _git gdm=git-diff
+function gdf { gd $(git merge-base --fork-point $1) }
+compdef _git gdf=git-diff
 
 alias gc='git commit -v'
 alias gcs='git commit -v --squash'
 
 alias gc='git commit -v'
 alias gcs='git commit -v --squash'
@@ -38,16 +40,23 @@ alias grrm='git remote remove'
 alias grset='git remote set-url'
 alias grup='git remote update'
 
 alias grset='git remote set-url'
 alias grup='git remote update'
 
-alias gb='git branch -vv'
-alias gba='git branch -a'
-alias gbm='git branch --merged'
-alias gbdm='git branch --merged | grep -ve "\*" -e "master" | xargs git branch -d'
+alias gb='git --no-pager branch -vv'
+alias gbv='git --no-pager branch -vv'
+alias gba='git --no-pager branch -a'
+alias gbm='git --no-pager branch -vv --merged'
+alias gbdm='git branch --merged | grep -ve "\*" -e "\+" -e "master" | xargs git branch -d'
+alias gsu='git branch --set-upstream-to'
+alias gsum='git branch --set-upstream-to=origin/HEAD'
+
+alias gwl='git worktree list'
+function gwa { git worktree add wt/$1 $1 }
+compdef _git gwa='_git_commits'
 
 alias gcl='git config --list'
 alias gcp='git cherry-pick'
 
 alias gcount='git shortlog -sn'
 
 alias gcl='git config --list'
 alias gcp='git cherry-pick'
 
 alias gcount='git shortlog -sn'
-alias glg='git --no-pager log --graph --max-count=20 --format:"%Cblue%cd %C(auto)%h%d %s" --date=short'
+alias glg='git --no-pager log --graph --max-count=20 --format="%Cblue%cd %C(auto)%h%d %s" --date=short'
 alias glg2='git --no-pager log --graph --max-count=20 --date=short --format="%C(blue)%cd %C(auto)%h %C(dim cyan)%an %C(bold green)(%ar)%C(auto)%-d%n %s"'
 function glm { glg "${1:-origin}".. }
 compdef _git glm=git-log
 alias glg2='git --no-pager log --graph --max-count=20 --date=short --format="%C(blue)%cd %C(auto)%h %C(dim cyan)%an %C(bold green)(%ar)%C(auto)%-d%n %s"'
 function glm { glg "${1:-origin}".. }
 compdef _git glm=git-log