Skip to content

Instantly share code, notes, and snippets.

@zaufi
Last active July 26, 2018 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zaufi/debdd4aa5932a0df7dc97cb31a23d752 to your computer and use it in GitHub Desktop.
Save zaufi/debdd4aa5932a0df7dc97cb31a23d752 to your computer and use it in GitHub Desktop.
My Git config w/ aliases & etc... (true color terminal required)
[core]
editor = mcedit
autocrlf = input
[alias]
aliases = config --get-regexp alias
br = branch
ci = commit
cl = clone
clm = "!f(){ r=$1; d=$(basename ${r//:/\\/} .git); git clone $r $d/master; };f"
co = checkout
cp = cherry-pick
cs = commit -s
ct = checkout -t
di = diff
fa = fetch --all --tags --prune --prune-tags
lg = log --pretty=format:'%C("#884444")%h%Creset %Cblue%G?%Creset %C("#e0a000")%d%Creset %s %C("#9040a0" "" italic)[%an %ad]%Creset' --date=relative --graph
lgp = log --pretty=format:'%C("normal" "#333333")---[ %C("#884444")%h%Creset%C("normal" "#333333") %Cblue%G?%Creset%C("normal" "#333333") %C("#e0a000")%d%Creset%C("normal" "#333333") %C("#9040a0" "" italic)%an <%ae> %ad%Creset%C("normal" "#333333") ]---%n%C("#dddddd" "" "bold")%-s%Creset%n%+b%n%C("#666666")%-N%n' --stat -p --date=relative --minimal
lgs = log --pretty=format:'%C("#884444")%h%Creset %Cblue%G?%Creset %C("#e0a000")%d%Creset %C("#dddddd" "" "bold")%-s%Creset %C("#9040a0" "" italic)[%an %ad]%Creset' --graph --stat
sl = shortlog
st = status
sub = submodule
sw = show --pretty=fuller
who = shortlog -snce
wt = worktree
wta = "!f(){ if [[ -d .git ]]; then d='../'; elif [[ -f .git ]]; then d=$(< .git); d=$(dirname $(sed -e 's,gitdir: ,,' -e 's,/.git.*,,' <<<$d))/; fi; [[ -n $d ]] && git worktree add $d$1 $1; };f"
wtb = "!f(){ if [[ -d .git ]]; then d='../'; elif [[ -f .git ]]; then d=$(< .git); d=$(dirname $(sed -e 's,gitdir: ,,' -e 's,/.git.*,,' <<<$d))/; fi; [[ -n $d ]] && git worktree add -b $1 $d$1; };f"
[branch]
autosetupmerge = always
autosetuprebase = always
[color]
branch = auto
diff = auto
grep = auto
interactive = auto
pager = true
showBranch = auto
status = auto
ui = true
[color "diff"]
meta = "#328cad" "" italic
frag = "#b060ff" "" italic
func = "#6b41a7" "" italic
old = "#c05040"
new = "#20ff70"
commit = "#30b0c0"
whitespace = "" "#c05040"
oldMoved = "#c03060"
newMoved = "#50b060"
oldMovedDimmed = "#802030"
oldMovedAlternative = "#d05030"
oldMovedAlternativeDimmed = "#a03020"
newMovedDimmed = "#307040"
newMovedAlternative = "#70e0a0"
newMovedAlternativeDimmed = "#407050"
[color "status"]
# header = "" ""
added = "#20ff70"
updated = "#20b070"
changed = "#c05040"
untracked = "#808080"
branch = "#ffff20" "" italic bold
nobranch = "#555522"
localBranch = "#e08030"
remoteBranch = "#8040e0"
unmerged = "#d05030"
[color "branch"]
current = "#ffff20" "" italic bold
local = "#e0a040"
remote = "#8040e0"
upstream = "#328cad" "" italic
plain = "#808080"
[color "decorate"]
branch = "#e0a040"
remoteBranch = "#8040e0"
tag = "#b060ff"
stash = "#30b0c0"
HEAD = "#e0a000"
[column]
ui = never
[commit]
verbose = 1
[diff]
colorMoved = dimmed_zebra
wsErrorHighlight = all
[fetch]
prune = true
[format]
pretty = oneline
signOff = true
[gpg]
program = gpg2
[log]
graphColors = "#909090", "#00557f", "#550000", "#55557f", "#555500", "#aa5500", "#005500"
abbrevCommit = true
decorate = true
[pager]
branch = false
tag = false
[pull]
rebase = true
verbose = true
[push]
default = simple
[status]
showStash = true
@zaufi
Copy link
Author

zaufi commented Jul 25, 2018

This is /etc/gitconfig. Private part stored in ~/.gitconfig (not in this gist %).

Some Details

  • clm -- clone a repo into repo/master directory
  • wta -- add a working tree for a branch/tag at the level of master/ directory
  • wtb -- create a local branch and add a working tree for it at the level of master/ directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment