Added new --prune-tags to git fetch alias

This commit is contained in:
Daniel Metzler 2025-04-15 17:10:52 +02:00
commit 6e158ec6cb
2 changed files with 11 additions and 4 deletions

View file

@ -90,7 +90,7 @@ plugins=(... git)
| `gdnolock` | `git diff $@ ":(exclude)package-lock.json" ":(exclude)\*.lock"` |
| `gdt` | `git diff-tree --no-commit-id --name-only -r` |
| `gf` | `git fetch` |
| `gfa` | `git fetch --all --tags --prune` |
| `gfa` | `git fetch --all --tags --prune --prune-tags --jobs=10` |
| `gfo` | `git fetch origin` |
| `gg` | `git gui citool` |
| `gga` | `git gui citool --amend` |

View file

@ -219,10 +219,17 @@ compdef _git gdnolock=git-diff
alias gdt='git diff-tree --no-commit-id --name-only -r'
alias gf='git fetch'
# --prune-tags was added in git 2.17
# --jobs=<n> was added in git 2.8
is-at-least 2.8 "$git_version" \
&& alias gfa='git fetch --all --tags --prune --jobs=10' \
|| alias gfa='git fetch --all --tags --prune'
if is-at-least 2.17 "$git_version"; then
alias gfa='git fetch --all --tags --prune --prune-tags --jobs=10'
elif is-at-least 2.8 "$git_version"; then
alias gfa='git fetch --all --tags --prune --jobs=10'
else
alias gfa='git fetch --all --tags --prune'
fi
alias gfo='git fetch origin'
alias gg='git gui citool'
alias gga='git gui citool --amend'