Skip to content

Instantly share code, notes, and snippets.

@agrawal-d
Created June 14, 2020 17:36
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 agrawal-d/81813f0fc597005a04f7c08bda5d2fc7 to your computer and use it in GitHub Desktop.
Save agrawal-d/81813f0fc597005a04f7c08bda5d2fc7 to your computer and use it in GitHub Desktop.
My .gitconfig configuration
[user]
email = <email here>
name = Divyanshu Agrawal
[alias]
last = log -1 HEAD
logline = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[core]
symlinks = true
abbrev = 9
[color]
ui = auto
[push]
default = current
[merge]
conflictstyle = diff3
defaultToUpstream = true
[rebase]
stat = true
[diff]
noprefix = true
# Use color to identify code that was moved around verbatim.
[diff]
# Enable the feature.
colorMoved = zebra
# Supercharge it to do the equivalent of `git diff -b`.
# The ideal criterion would be pure leading-whitespace changes;
# but "allow-indentation-change" actually allows whitespace
# changes anywhere, even breaking up words.
colorMovedWS = ignore-space-change
[color "diff"]
# The default colors stay within the classic 16-color palette,
# which is pretty constraining: old/"-" lines are bold magenta
# or bold blue, and new/"+" lines are cyan or yellow. With a
# modern terminal emulator, we can do much better.
#
# Our approach: Old/"-" and new/"-" lines should be in reddish
# and greenish hues, consistent with non-moved code.
#
# We also add a faint gray (or yellow-gray) background, to
# help mark it as moved in a way that reduces emphasis --
# assuming a black terminal background. If using a light
# terminal background, then substituting light gray in these
# backgrounds should give the same effect.
oldMoved = "#ff0077 #222222"
oldMovedAlternative = "#ff3322 #222a00"
newMoved = "#00cc77 #222222"
newMovedAlternative = "#66aa00 #222a00"
[branch]
autosetupmerge = always
[credential]
helper = cache --timeout=36000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment