de3b14cf69eeb43797bae8320af6972032b604ff

Author
Julien Janvier <3691804+jjanvier@users.noreply.github.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

git: add aliases for git switch and restore (#8089)

Diff

 1diff --git a/plugins/git/README.md b/plugins/git/README.md
 2index fc89b27e0377347c85cec749b86fb722120781cd..3311ccf552356a599a4ef8d16ca0d1667cab5ee7 100644
 3--- a/plugins/git/README.md
 4+++ b/plugins/git/README.md
 5@@ -131,7 +131,9 @@ plugins=(... git)
 6 | grmc                 | git rm --cached                                                                                                               |
 7 | grmv                 | git remote rename                                                                                                             |
 8 | grrm                 | git remote remove                                                                                                             |
 9+| grs                  | git restore                                                                                                                   |
10 | grset                | git remote set-url                                                                                                            |
11+| grss                 | git restore --source                                                                                                          |
12 | grt                  | cd "$(git rev-parse --show-toplevel \|\| echo .)"                                                                             |
13 | gru                  | git reset --                                                                                                                  |
14 | grup                 | git remote update                                                                                                             |
15@@ -154,6 +156,8 @@ plugins=(... git)
16 | gsts                 | git stash show --text                                                                                                         |
17 | gstall               | git stash --all                                                                                                               |
18 | gsu                  | git submodule update                                                                                                          |
19+| gsw                  | git switch                                                                                                                    |
20+| gswc                 | git switch -c                                                                                                                 |
21 | gts                  | git tag -s                                                                                                                    |
22 | gtv                  | git tag \| sort -V                                                                                                            |
23 | gtl                  | gtl(){ git tag --sort=-v:refname -n -l ${1}* }; noglob gtl                                                                    |
24diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh
25index e0ce27fd4b684ccf514eea493f3cb4049af7ba8f..9787392de44f9d533a70f9d6ac04dcbc12c49165 100644
26--- a/plugins/git/git.plugin.zsh
27+++ b/plugins/git/git.plugin.zsh
28@@ -207,7 +207,9 @@ alias grm='git rm'
29 alias grmc='git rm --cached'
30 alias grmv='git remote rename'
31 alias grrm='git remote remove'
32+alias grs='git restore'
33 alias grset='git remote set-url'
34+alias grss='git restore --source'
35 alias grt='cd "$(git rev-parse --show-toplevel || echo .)"'
36 alias gru='git reset --'
37 alias grup='git remote update'
38@@ -236,6 +238,8 @@ alias gstp='git stash pop'
39 alias gsts='git stash show --text'
40 alias gstall='git stash --all'
41 alias gsu='git submodule update'
42+alias gsw='git switch'
43+alias gswc='git switch -c'
44 
45 alias gts='git tag -s'
46 alias gtv='git tag | sort -V'