Skip to content

Instantly share code, notes, and snippets.

@juliendufresne
Created March 2, 2017 20:04
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 juliendufresne/1fa8e14230dcfe8e30d3091828ab9a53 to your computer and use it in GitHub Desktop.
Save juliendufresne/1fa8e14230dcfe8e30d3091828ab9a53 to your computer and use it in GitHub Desktop.
Mon .gitconfig (version non maintenue à jour)
[alias]
###
### branch
###
b = branch --all
###
### checkout
###
co = checkout
ours = "!f() { git checkout --ours $@ && git add $@; }; f"
theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
###
### commit
###
c = commit
cm = commit -m
###
### diff
###
d = diff --check
d = diff --check --cached
###
### fetch
###
f = fetch --all --prune
###
### log
###
l = log --oneline
lg = log --graph --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset'
###
### pull
###
pl = pull --rebase
###
### push
###
ps = push
pf = push --force-with-lease
pushf = push --force-with-lease
###
### rebase
###
r = rebase
rbm = "!f() { [ $(git status --porcelain | wc -l) -eq 0 ] || { echo 'Your current branch have some changes'; return 1; }; (set -x;git checkout ${1-master} && git pull --rebase && git checkout - && git rebase ${1-master}); }; f"
rcont = rebase --continue
rabort = rebase --abort
###
### status
###
s = status
st = status
###
### extra
###
# count the number of commits that differs from another branch (default: master)
count = "!f() { compareBranch=${1-master}; git rev-list --count HEAD ^$compareBranch; }; f"
[color]
ui = auto
[color "branch"]
current = yellow bold
local = yellow
remote = blue
[color "diff"]
meta = yellow
frag = magenta bold
old = red bold
new = green bold
whitespace = red reverse
[color "status"]
added = green
changed = yellow
untracked = red
[commit]
gpgsign = true
[core]
editor = vim
excludesfile = ~/.gitignore_global
[diff]
renames = true
[pull]
rebase = true
[push]
# Default push should only push the current branch to its push target, regardless of its remote name
default = upstream
# When pushing, also push tags whose commit-ishs are now reachable upstream
followTags = true
#[rerere]
# enabled = true
# autoupdate = true
[status]
showUntrackedFiles = all
[tag]
sort = version:refname
[user]
name = Julien Dufresne
email = me@myemail.tld
signingkey = 991AD3089F49BCBFF422A8B2C164B5489D30DAD7
[versionsort]
prereleaseSuffix = -pre
prereleaseSuffix = .pre
prereleaseSuffix = -beta
prereleaseSuffix = .beta
prereleaseSuffix = -rc
prereleaseSuffix = .rc
[web]
browser = google-chrome
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment