Skip to content

Instantly share code, notes, and snippets.

@alexisduque
Last active February 15, 2017 18:14
Show Gist options
  • Save alexisduque/71f037121ac055a66f8ef6cbb8e7a76b to your computer and use it in GitHub Desktop.
Save alexisduque/71f037121ac055a66f8ef6cbb8e7a76b to your computer and use it in GitHub Desktop.
My ehanced .gitconfig
[user]
name = Alexis Duque
email = [email protected]
[core]
editor = vim
pager = less
excludesfile = ~/.gitignore_global
autocrlf = input
# dsf depends on diff-so-fancy : npm install -g diff-so-fancy
[alias]
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
wdiff = diff --word-diff
dsf = "!f() { [ -z \"$GIT_PREFIX\" ] || cd \"$GIT_PREFIX\" && git diff --color \"$@\" | diff-so-fancy | less --tabs=4 -RFX; }; f"
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --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(bold white)— %an%C(reset)' --abbrev-commit
lg = !"git lg1"
# activate color for all commands
[color]
ui = auto
# diff with meaningful prefix and word-diff will find a letter as a word
[diff]
mnemonicprefix = true
wordRegex = .
# clean is forced by default
[clean]
requireForce = false
# commands will be autocorrect (rset -> reset)
[help]
autocorrect = -1
# remember previous conflict resolutions
[rerere]
enabled = true
# push only the current branch to its upstream branch
[push]
default = upstream
# rebase --interactive will change the action word depending on the commit message ('fixup!' -> 'fixup')
# autostash will stash a dirty tree, rebase, then unstash
[rebase]
autosquash = true
autostash = true
# pull will do a rebase instead of a merge
[pull]
rebase = true
# merge is looking harder for renames
[merge]
renamelimit = 3000
# order tags correctly since Git 2.1
[tag]
sort = version:refname
# status will see inside untracked directories
[status]
showUntrackedFiles = all
[credential]
helper = !aws --profile CodeCommitProfile codecommit credential-helper $@
UseHttpPath = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment