Skip to content

Instantly share code, notes, and snippets.

@jcarsique jcarsique/.gitaliases
Last active Jul 4, 2018

Embed
What would you like to do?
.gitconfig @nuxeo
# Standalone aliases install:
# wget https://gist.githubusercontent.com/jcarsique/24f8dd46d176bb67253e/raw/.gitaliases -O .git/gitaliases
# git config include.path gitaliases
[alias]
ls = "ls-tree --name-only"
ll = "ls-tree -l"
st = status -sb
ci = commit
co = checkout
br = branch
branches = branch -a
glog = log --graph --abbrev-commit --date=relative
mergenff = merge --no-ff
in = "!git remote update -p; git log ..@{u}"
out = log @{u}..
outall = log --branches --not --remotes=origin
#lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --color
lg = log --graph --pretty=format:'%C(auto)%h -%d %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --color
logd = log --left-right --graph --cherry-pick --oneline ...@{u}
#logone = log --oneline --left-right --cherry-pick
logone = log --pretty=format:'%C(auto)%m %h %Cgreen%ad %C(blue)%<(20)%aN %Creset%s %N %C(auto)%d' --left-right --cherry-pick --date=short
di = diff
dic = diff --staged
id = show -s --pretty=format:'%C(auto)%h%d'
pullr = "!git fetch \"$@\" && git rebase --autostash @{push}"
pullnor = pull --no-rebase
who = "shortlog -ne --format='%h %s'"
rollback = reset --soft HEAD^
lc = log --pretty=oneline --abbrev-commit --graph --decorate ORIG_HEAD.. --stat --no-merges
latest = for-each-ref --count=10 --sort=-committerdate --format='%(committerdate:short) %(refname:short)'
latestl = for-each-ref --count=10 --sort=-committerdate refs/heads --format='%(committerdate:short) %(refname:short)'
#authorship = "!git ls-files -z|xargs -0 -n1 -E'\n' -J {} git blame --date short -wCMcp '{}'| perl -pe 's/^.*?\\((.*?) +\\d{4}-\\d{2}-\\d{2} +\\d+\\).*/\\1/'| sort | uniq -c | sort -rn"
authorship = "!git ls-files -z|xargs -0 -n1 -E'\n' | git blame --date short -wCMcp -- | perl -pe 's/^.*?\\((.*?) +\\d{4}-\\d{2}-\\d{2} +\\d+\\).*/\\1/'| sort | uniq -c | sort -rn"
#fix = "!_() { c=$(git rev-parse $1) && git commit --fixup $c && git diff-index --quiet HEAD; s=$?; [ $s != 0 ] && git stash; git -c core.editor=cat rebase -i --autosquash --keep-empty $c~ && [ $s != 0 ] && git stash pop; }; _"
fix = "!_() { c=$(git rev-parse $1) && git commit --fixup $c && git -c core.editor=cat rebase -i --autosquash --keep-empty --autostash $c~; }; _"
rebasei = "!_() { git diff-index --quiet HEAD; s=$?; [ $s != 0 ] && git stash; git rebase -i $1 && [ $s != 0 ] && git stash pop; }; _"
# git clone https://github.com/git-cola/git-cola ~/workspace/git-cola
xbase = "!GIT_SEQUENCE_EDITOR=$HOME/workspace/git-cola/share/git-cola/bin/git-xbase git rebase"
stash-rename = "!_() { rev=$(git rev-parse $1) && git stash drop $1 || exit 1 ; git stash store -m \"$2\" $rev; }; _"
rbranch-rename = "!_() { [ \"$#\" -lt 2 ] && echo 'Usage: rbranch-rename [remote] old_branch_name new_branch_name' && exit 1; \
if [ \"$#\" -gt 2 ]; then REMOTE=$1; shift; else REMOTE=origin; fi; git push $REMOTE $REMOTE/$1:refs/heads/$2 :$1; }; _"
oldest-ancestor = !bash -c 'diff -u1 <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | sed -ne \"s/^ //p\"' -
pr-hash = !sh -c 'git ls-remote origin| grep "refs/pull/$1/head"| cut -f1' -
[user]
name = Julien Carsique
email = ...
[include]
# wget https://gist.githubusercontent.com/jcarsique/24f8dd46d176bb67253e/raw/.gitaliases
path = .gitaliases
[color]
diff = auto
interactive = auto
showbranch = true
sh = auto
branch = auto
grep = auto
ui = auto
status = auto
[core]
autocrlf = input
safecrlf = warn
# git clone https://github.com/github/gitignore ~/workspace/gitignore
excludesfile = $HOME/workspace/gitignore/Global/Eclipse.gitignore
ignorecase = false
whitespace = trailing-space,space-before-tab
pager = less -FXRS
[init]
# mkdir -p ~/.git_template/hooks/
# wget https://gist.githubusercontent.com/jcarsique/7643059/raw/adc53560307a898c9327e4521c659072f90c7243/pre-commit -O ~/.git_template/hooks/pre-commit
templatedir = ~/.git_template
[apply]
whitespace = fix
[push]
default = upstream
[branch]
autosetupmerge = true
autosetuprebase = always
[diff]
renames = true
copies = true
mnemonicprefix = true
tool = diffmerge
[merge]
conflictstyle = diff3
tool = diffmerge
renormalize=true
[mergetool]
keepBackup = false
[mergetool "diffmerge"]
cmd = diffmerge --merge --result=$MERGED $LOCAL $BASE $REMOTE
trustExitCode = true
[difftool "diffmerge"]
cmd = diffmerge $LOCAL $REMOTE
[difftool "kdiff3"]
trustExitCode = false
[mergetool "kdiff3"]
trustExitCode = false
[difftool "meld"]
trustExitCode = false
[mergetool "meld"]
trustExitCode = false
[guitool "Rebase onto..."]
cmd = git rebase
revprompt = yes
[guitool "Rebase/Continue"]
cmd = git rebase --continue
[guitool "Rebase/Skip"]
cmd = git rebase --skip
[guitool "Rebase/Abort"]
cmd = git rebase --abort
[guitool "Pull with Rebase"]
cmd = git pull --rebase
[gui]
spellingdictionary = none
encoding = utf-8
[github]
# sudo gem install hub
# hub hub standalone > ~/bin/hub && chmod +x ~/bin/hub
user = jcarsique
token = ...
[achievement]
upload = true
# git clone https://github.com/jcarsique/git-achievements ~/workspace/git-achievements
dir = $HOME/workspace/git-achievements
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = ...
smtpserverport = 587
confirm=always
[git-up "bundler"]
# sudo gem install git-up
check = true
[rerere]
enabled = true
[pull]
rebase = preserve
[diff "word"]
# Requires ~/bin/docx2txt executable containing: "docx2txt.pl $1 -"
# Used in Git attributes file with: "*.docx diff=word"
textconv = docx2txt
[diff "exif"]
# Used in Git attributes file with: "*.jpg diff=exif"
textconv = exiftool
[filter "lfs"]
smudge = git-lfs smudge -- %f
required = true
clean = git-lfs clean -- %f
[remote "origin"]
fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.