From cae6099b956ed3d3f3156af92d0833a2e09f92f3 Mon Sep 17 00:00:00 2001 From: Bartek Stalewski Date: Tue, 8 Oct 2024 12:33:04 +0200 Subject: [PATCH] Better git aliases. --- config/zsh/aliases.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh index 5517cf9..58d3ef3 100644 --- a/config/zsh/aliases.zsh +++ b/config/zsh/aliases.zsh @@ -4,10 +4,15 @@ alias ga='git add .; git commit --no-edit --amend; git push --force-with-lease' alias gae='git add .; git commit --amend; git push --force-with-lease' gd() { curr_branch=$(git symbolic-ref --short -q HEAD) + if [ $curr_branch = "master" ]; then + echo "On master, aborting." + return + fi git checkout master git branch -D ${curr_branch} git pull } +alias gl="git log --graph --abbrev-commit --date=short --pretty=format:'%Cred%h%Creset %Cgreen%cr%Creset: %s : %C(bold blue)%an%Creset %C(yellow)%d%Creset'" alias less='less -R'