zshrc: Add shortcut to "move" git tags

This commit is contained in:
Jannik Beyerstedt 2024-11-25 14:16:37 +01:00
parent dc652c9a2d
commit 4034ab0b6a
2 changed files with 14 additions and 1 deletions

View file

@ -113,7 +113,7 @@
- { - {
src: "{{ role_path }}/templates/htoprc.j2", src: "{{ role_path }}/templates/htoprc.j2",
dest: "{{ ansible_user_dir }}/.config/htop/htoprc", dest: "{{ ansible_user_dir }}/.config/htop/htoprc",
force: no, force: false,
} }
- name: Usersettings - Set global gitconfig - name: Usersettings - Set global gitconfig
when: usersetup_gitconfig == true when: usersetup_gitconfig == true

View file

@ -107,6 +107,19 @@ alias doch='sudo sh -c "$(fc -n -l -- -1)"'
alias git-reset-pull='git fetch && git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)' alias git-reset-pull='git fetch && git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)'
alias git-force-push='git push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease' alias git-force-push='git push origin $(git rev-parse --abbrev-ref HEAD) --force-with-lease'
git_retag() {
# delete specified tag, add to current HEAD again and push
remote="origin"
if [ "$#" -ge "2" ]; then
remote=$2;
fi
if [ "$#" -ge "1" ]; then
echo "git tag -d $1 && git push $remote :$1 && git tag $1 && git push $remote $1"
else
echo "ERROR: Please provide a tag name and optionally a remote name (default = 'origin')"
fi
}
# mpv # mpv
alias mpv="mpv --autofit=70%" alias mpv="mpv --autofit=70%"