From ac0924930d48217e127523809dc5d386fb3403a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ho=C3=A0ng?= <10150902+hoang-himself@users.noreply.github.com> Date: Mon, 7 Nov 2022 15:47:59 +0700 Subject: [PATCH] feat(git): add aliases for `worktree` (#10079) --- plugins/git/README.md | 11 ++++++++--- plugins/git/git.plugin.zsh | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/git/README.md b/plugins/git/README.md index 050c13d81..f1c8b81c4 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -91,8 +91,8 @@ plugins=(... git) | gignore | git update-index --assume-unchanged | | gignored | git ls-files -v \| grep "^[[:lower:]]" | | git-svn-dcommit-push | git svn dcommit && git push github $(git_main_branch):svntrunk | -| gk | gitk --all --branches &! | -| gke | gitk --all $(git log -g --pretty=%h) &! | +| gk | gitk --all --branches &! | +| gke | gitk --all $(git log -g --pretty=%h) &! | | gl | git pull | | glg | git log --stat | | glgp | git log --stat -p | @@ -184,7 +184,7 @@ plugins=(... git) | gupom | git pull --rebase origin $(git_main_branch) | | gupomi | git pull --rebase=interactive origin $(git_main_branch) | | glum | git pull upstream $(git_main_branch) | -| gluc | git pull upstream $(git_current_branch) | +| gluc | git pull upstream $(git_current_branch) | | gwch | git whatchanged -p --abbrev-commit --pretty=medium | | gwip | git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" | | gam | git am | @@ -192,6 +192,11 @@ plugins=(... git) | gams | git am --skip | | gama | git am --abort | | gamscp | git am --show-current-patch | +| gwt | git worktree | +| gwta | git worktree add | +| gwtls | git worktree list | +| gwtmv | git worktree move | +| gwtrm | git worktree remove | ### Main branch preference diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 5c0e6db2c..fc7699237 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -315,6 +315,12 @@ alias gluc='git pull upstream $(git_current_branch)' alias gwch='git whatchanged -p --abbrev-commit --pretty=medium' alias gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]"' +alias gwt='git worktree' +alias gwta='git worktree add' +alias gwtls='git worktree list' +alias gwtmv='git worktree move' +alias gwtrm='git worktree remove' + alias gam='git am' alias gamc='git am --continue' alias gams='git am --skip'