sundry/zsh/lib/git.zsh

17 lines
456 B
Bash

function git-parent-branch {
git show-branch -a \
| grep '\*' \
| grep -v `git-rev-parse --abbrev-ref HEAD` \
| head -n1 \
| sed 's/.*\[\(.*\)\].*/\1/' \
| sed 's/[\^~].*//'
}
alias gpb=git-parent-branch
# Use this to define the git lg alias
function define_gitlg {
git config --global alias.lg log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit
}