Global git config
# Edit using:
# git config -e --global
[user]
name = Me
email = email@example.com
[alias]
st = status
ci = commit
cia = commit --amend
co = checkout
# Give the current branch
cb = "!echo $(b=$(git symbolic-ref -q HEAD); { [ -n \"$b\" ] && echo ${b##refs/heads/}; } || echo HEAD)"
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
df = diff
dfc = diff --cached
dfh = diff HEAD^
l = !git lll -1
ll = !git lll -5
lll = log --format='%Cred%h%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset%C(yellow)%d%Creset' --no-merges
gr = grep -n --color
rb = rebase
rba = rebase --abort
rbc = rebase --continue
rbi = rebase -i
rmb = "!cb=\"$(git cb)\" && [[ $cb != \"master\" ]] && git co master && git branch -d $cb"
# Moodle specific
# Check out the stable branch (master, MOODLE_23_STABLE, ...)
com = "!git checkout $(b=$(mdk info --var stablebranch 2> /dev/null); { [ $? ] && [ $b != \"None\" ] && echo $b; } || echo master)"
# Shortcut to mdk fix
fix = "!mdk fix"
# Create the patch files for the current branch and rename them accordingly
patch = "!for h in $(git format-patch $(mdk info -v stablebranch 2> /dev/null)...$(git cb)); do n=\"$(mdk info -v identifier 2> /dev/null)-$h\"; echo $n; mv \"$h\" \"$n\"; done"
onepatch = "!$(git format-patch $(mdk info -v stablebranch 2> /dev/null)...$(git cb) --stdout > \"`git cb`.patch\" ); echo \"`git cb`.patch\""
[color]
auto = yes
[diff]
color = auto
[core]
editor = vim
filemode = false
whitespace = true