#[user]
#	 email = myuser@domain.net
#	 name = My User

[core]
	pager = less -x2
  #hooksPath = ~/.config/git/hooks/

[credential]
	# Keep in cache credentials 24h
	helper = cache --timeout=86400

[push]
	default = simple

[color]
	ui = auto
	diff = auto
	status = auto
	branch = auto
	all = auto

[color "diff"]
	whitespace = "red reverse"

[color "branch"]
	remote = yellow

[alias]

	# Simple Aliases
	st = status -sb
	br = branch
	bra = branch -av
	brdr = push --delete  
	co = checkout
	cob = checkout -b
	c = commit --verbose
	cm = commit -m
	a = add
	ap = add -p
	wdiff = diff --color-words

	# Personal aliases
	subup = submodule update --init
	unstage = reset HEAD 
	rms = rm --cached
	alias = "!git config -l | grep alias | cut -c 7-"

  # Log commands
  l = log --pretty=oneline --abbrev-commit --graph --decorate --all --date-order --pretty=format:'%C(yellow)%h%Creset%C(auto)%d %Creset%s %C(dim)(%an, %cr)'
  ll = log --graph --date=short --all --date-order

  # Show all references, even the lost ones
  lll = log --pretty=oneline --abbrev-commit --graph  --all --date-order --branches  --reflog

  # Unecessary useless
	rao = remote add origin
	rs = remote show 
	rso = remote show origin

  # Workflow commands
	sync = push -u origin --all
	syncall = "!git fetch --all; git push -u origin --all"
	wip = commit -am "WIP" 
	save = !git add -A && git commit -m 'SAVEPOINT'
	wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard

	undo-commit = reset --soft HEAD~1
	undo = reset HEAD~1 --mixed

	# Advanced aliases
	# quick-amend = !VISUAL=/bin/true git commit --amend
	# sync = !git pull --rebase && git push
	# merge-to = "!f() { local DEST=$1 ; shift ; local CURRENT=`git rev-parse --abbrev-ref HEAD` && git checkout "$DEST" && git merge "$CURRENT" $@ && git checkout "$CURRENT"; unset CURRENT; }; f"

	# ca = commit -a --verbose
	# cam = commit -a -m
	# m = commit --amend --verbose
	# 
	# d = diff
	# ds = diff --stat
	# dc = diff --cached
	# 
	# # list branches sorted by last modified
	# b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'"
	# 

[url "https://github.com/"]
	insteadOf = gh:

[url "https://gist.github.com/"]
	insteadOf = gist:

[url "https://bitbucket.org/"]
	insteadOf = bb:

[status]
	submoduleSummary = true

[diff]
	submodule = log

