bpg
12/2/2018 - 11:55 PM

Useful git aliases

Useful git aliases

# Drop this into your ~/.gitconfig

[alias]
	lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
	lga = !git lg --all
	br = !git branch -vv --color | egrep --color 'gone|$'
	dm = !bash -c '\
		REMOTE=$1 && \
		REMOTE=${REMOTE:="origin"} && \
		echo "Fetching $REMOTE" && \
		git fetch $REMOTE --prune  && \
		git branch -vv | grep "gone]" | awk \"{ print \\$1 }\" | xargs git branch -d' - 
	
  bra = !"git for-each-ref --sort='-authordate:iso8601' --format=' %(color:green)%(authordate:iso8601)%09%(color:white)%(refname:short)' refs/heads"