Skip to content

Instantly share code, notes, and snippets.

@bsara
Last active March 18, 2024 04:11
Show Gist options
  • Save bsara/4a7069cc3319d1ec63d7cc4242921cc2 to your computer and use it in GitHub Desktop.
Save bsara/4a7069cc3319d1ec63d7cc4242921cc2 to your computer and use it in GitHub Desktop.
Standard .gitconfig sections
[branch]
autosetuprebase = always
[core]
autocrlf = false
ignorecase = false
[push]
default = simple
[pull]
default = simple
[alias]
a = add
aa = add -A
ai = add --interactive
b = branch
br = branch -r
f = fetch
ps = push
pl = pull
plr = pull -r
pmr = pull -r origin master
c = commit
cam = commit --amend
co = checkout
cp = cherry-pick
cpa = cherry-pick --abort
cpc = cherry-pick --continue
m = merge
rb = rebase
rba = rebase --abort
rbc = rebase --continue
s = status
sm = submodule
smu = submodule update --init
smur = submodule update --init --recursive
t = tag
rv = !git stash && git stash drop
pr = remote update --prune
rmb = !sh -c 'git push origin :refs/heads/$1 && git branch -D $1' -
rmt = !sh -c 'git push origin :refs/tags/$1 && git tag -d $1' -
mg = mergetool
d = difftool
df = diff --name-status
dw = diff -w
l = log --abbrev-commit --first-parent --pretty=format:'%C(dim white)%h%C(reset)%C(bold green)%d%C(reset) %s %C(yellow)<%an>%C(reset)'
ll = log --abbrev-commit --graph --pretty=format:'%C(dim white)%h%C(reset)%C(bold green)%d%C(reset) %s %C(yellow)<%an>%C(reset)'
ld = log --abbrev-commit --first-parent --pretty=format:'%C(bold blue)%ai%C(reset) - %C(dim white)%h%C(reset)%C(bold green)%d%C(reset) %s %C(yellow)<%an>%C(reset)'
lda = log --abbrev-commit --graph --pretty=format:'%C(bold blue)%ai%C(reset) - %C(dim white)%h%C(reset)%C(bold green)%d%C(reset) %s %C(yellow)<%an>%C(reset)'
la = log --abbrev-commit --name-status --first-parent --pretty=format:'%C(dim white)%h%C(reset)%C(bold green)%d%C(reset) %s %C(yellow)<%an>%C(reset)'
lla = log --abbrev-commit --name-status --pretty=format:'%C(dim white)%h%C(reset)%C(bold green)%d%C(reset) %s %C(yellow)<%an>%C(reset)'
lg = !git lg1
lg1 = !git lg1-specific --all
lg2 = !git lg2-specific --all
lg3 = !git lg3-specific --all
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lg2-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'
lg3-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'
[diff]
tool = meld
[diff "exif"]
binary = true
cachetextconv = true
textconv = exiftool
[diff "docx"]
binary = true
textconv = docx2txt
[diff "odt"]
binary = true
textconv = odt2txt
[difftool "intellij"]
cmd = idea diff "$LOCAL" "$REMOTE"
[merge]
tool = meld
conflictstyle = diff3
[mergetool "meld"]
cmd = meld "$LOCAL" "$MERGED" "$REMOTE"
[mergetool "intellij"]
cmd = idea merge "$LOCAL" "$REMOTE" "$BASE" "$MERGED"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment