Skip to content

Instantly share code, notes, and snippets.

@piouPiouM
Created March 23, 2017 10:15
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 piouPiouM/94865b6430afc02941dd18ca1fd2ffd9 to your computer and use it in GitHub Desktop.
Save piouPiouM/94865b6430afc02941dd18ca1fd2ffd9 to your computer and use it in GitHub Desktop.
My Git configuration
[user]
name = Mehdi Kabab
[color]
ui = auto
[core]
excludesfile = ~/.config/git/ignore
editor = nvim
whitespace = -trailing-space
# Make `git rebase` safer on macOS
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
# Prevent showing files whose names contain non-ASCII symbols as unversioned.
# http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
precomposeunicode = false
[alias]
ci = commit
st = status
s = status -s
oneline = log --pretty=oneline --abbrev-commit --graph --decorate
lg = log --graph --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ar)%Creset'
lc = !git lg @{u}..
l = !git oneline -n 20
amend = commit --amend
oops = commit --amend --no-edit
who = shortlog -sne
changes = diff --name-status
dic = diff --cached
diffstat = diff --stat
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master"
# Clone a repository including all submodules
c = clone --recursive
# Commit all changes
ca = !git add -A && git commit -av
svnpull = svn rebase
svnpush = svn dcommit
addm = !git-ls-files -m -z | xargs -0 git-add && git status
addu = !git-ls-files -o --exclude-standard -z | xargs -0 git-add && git status
rmm = !git ls-files -d -z | xargs -0 git-rm && git status
mate = !git-ls-files -m -z | xargs -0 mate
mateall = !git-ls-files -m -o --exclude-standard -z | xargs -0 mate
undo = git reset --soft HEAD^
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[credential]
helper = osxkeychain
[rerere]
# https://delicious-insights.com/fr/articles/git-rerere/
enabled = true
autoupdate = true
[status]
submoduleSummary = true
showUntrackedFiles = all
[diff]
submodule = log
wordRegex = .
mnemonicPrefix = true
[merge]
conflictStyle = diff3
[mergetool]
keepBackup = false
keepTemporaries = false
writeToTemp = true
prompt = false
[fetch]
recurseSubmodules = on-demand
[pull]
rebase = preserve
[push]
default = upstream
[grep]
extendedRegexp = true
[log]
abbrevCommit = true
follow = true
[tag]
# Sort tags as version numbers whenever applicable, so 1.10.2 is AFTER 1.2.0.
sort = version:refname
[versionsort]
prereleaseSuffix = -pre
prereleaseSuffix = .pre
prereleaseSuffix = -beta
prereleaseSuffix = .beta
prereleaseSuffix = -rc
prereleaseSuffix = .rc
[include]
# Declare in this optional local file your email address, GitHub credencials, your difftool and mergetool, etc…
path = ~/.local/git/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment