Skip to content

Instantly share code, notes, and snippets.

@timurista
Created February 15, 2018 15:54
Show Gist options
  • Save timurista/dfe157a7281623a0f4b6982bd3f9feb7 to your computer and use it in GitHub Desktop.
Save timurista/dfe157a7281623a0f4b6982bd3f9feb7 to your computer and use it in GitHub Desktop.
some default settings for the gitconfig
[core]
editor = code --wait
[alias]
# one-line log
lg = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
dl = branch -D
dlremote = "!f() { git branch -D \"$@\" && git push origin --delete \"$@\"; }; f"
co = checkout
st = status -s
newbranch = "!f() { git checkout -b $@ && git push -u origin $@; }; f"
nb = "!f() { git checkout -b $@ && git push -u origin $@; }; f"
# git add commit and push together
cmp = "!f() { git add -A && git commit -m \"$@\" && git push; }; f"
# list branches sorted by last modified
br = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
# list aliases
aliases = "!git config -l | grep alias | cut -c 7-"
lb = checkout @{-1}
sync = "!f() { git checkout \"develop\" && git pull && git lb && git merge \"develop\";}; f "
edit = config --global --edit
[user]
name = Tim Urista
user = timurista
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[mergetool "sourcetree"]
cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment