1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

git diff now uses --color-words

This commit is contained in:
Joe Groocock 2017-11-15 23:21:27 +00:00
parent 334e619863
commit dd4faa7b6c
Signed by: frebib
GPG Key ID: E0B16BEACFBB6A86

View File

@ -97,6 +97,7 @@ alias gcl="git clone --recursive"
alias gco="git checkout" alias gco="git checkout"
alias gcom="git checkout master" alias gcom="git checkout master"
alias ga="git add" alias ga="git add"
alias gap="git -c interactive.diffFilter=\"git diff --color-words\" add -p"
alias gaa="ga -A" alias gaa="ga -A"
alias grm="git rm" alias grm="git rm"
alias gc="git commit" alias gc="git commit"
@ -117,18 +118,19 @@ alias gp="git push"
alias gpf="gp --force" alias gpf="gp --force"
alias gpsu="git push --set-upstream" alias gpsu="git push --set-upstream"
alias gpsuom="git push --set-upstream origin master" alias gpsuom="git push --set-upstream origin master"
alias gpall="git remote | xargs -L1 git push"
alias gl="git pull --rebase" alias gl="git pull --rebase"
alias glp="gl && gp" alias glp="gl && gp"
gd() { gd() {
local commit=$1 local commit=$1
if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then if [ -z "$commit" ] || [ ${commit:0:1} != '@' ]; then
git diff $@ git diff --color-words $@
return return
else else
git diff "@~${commit:1}^!" git diff --color-words "@~${commit:1}^!"
fi fi
} }
alias gds="git diff --staged" alias gds="git diff --staged --color-words"
alias glg="git log --stat --color" alias glg="git log --stat --color"
alias glog="git log --oneline --decorate --color --graph" alias glog="git log --oneline --decorate --color --graph"