Last active
November 23, 2022 12:26
-
-
Save FMCorz/57b56f34bda53dc73dcf95eef4e90e4d to your computer and use it in GitHub Desktop.
Global git config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Edit using: | |
# git config -e --global | |
[user] | |
name = Me | |
email = [email protected] | |
[alias] | |
ap = add -p | |
au = add -u | |
bl = branch -l | |
bla = branch -la | |
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" | |
rt = remote -v | |
st = status | |
stu = status -uno | |
# 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 | |
[push] | |
default = current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment