Skip to content

Instantly share code, notes, and snippets.

@jcarsique jcarsique/.gitaliases
Last active Mar 16, 2020

Embed
What would you like to do?
.gitconfig @nuxeo
# Standalone aliases install:
# wget https://gist.githubusercontent.com/jcarsique/24f8dd46d176bb67253e/raw/.gitaliases -O ~/.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:'%C(auto)%h -%d %s %Cgreen(%cr) %C(bold blue)<%an> %C(green bold)%G?' --abbrev-commit --color
logd = log --left-right --graph --cherry-pick --oneline ...@{u}
logone = log --pretty=format:'%C(auto)%m %h %Cgreen%ad %C(blue)%<(20)%aN %Creset%s %N %C(auto)%d %C(green bold)%G?' --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' | 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 git blame --line-porcelain HEAD|grep \"^author \"|sort|uniq -c|sort -nr"
fix = "!_() { : git rev-parse ; c=$(git rev-parse $1) && git commit --fixup $c && git -c core.editor=cat rebase -i --autosquash --keep-empty --autostash $c~; }; _"
rebasei = "!_() { : git rebase -i ; 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 = "!_() { : git stash drop ; rev=$(git rev-parse $1) && git stash drop $1 || exit 1 ; git stash store -m \"$2\" $rev;}; _"
rbranch-rename = "!_() { : git branch ; [ \"$#\" -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 ': git branch ; 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 checkout ; git ls-remote origin| grep \"refs/pull/$1/head\"| cut -f1' -"
resign = "!_() { : git checkout ; [ \"$#\" -eq 0 ] && echo 'Usage: resign <rev-list>' && exit 2; \
git filter-branch --commit-filter ' \
if [ \"$GIT_COMMITTER_EMAIL\" = \"jcarsique@nuxeo.com\" ]; then git commit-tree -S \"$@\"; else git commit-tree \"$@\"; fi' $1; }; _"
[user]
name = Julien Carsique
email = ...
signingKey = ...
[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
#pager = diff-so-fancy | less --tabs=4 -RFX
[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
[difftool "atom"]
[mergetool "atom"]
cmd = atom -w $MERGED
trustExitCode = false
[difftool "intellij"]
cmd = /snap/bin/intellij-idea-community diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
[mergetool "intellij"]
cmd = /snap/bin/intellij-idea-community merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[difftool "idea"]
cmd = idea diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE")
[mergetool "idea"]
cmd = idea merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[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
[remote "origin"]
fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
[gpg]
program = gpg2
[commit]
gpgSign = true
[tag]
forceSignAnnotated = true
[color "diff-highlight"]
oldNormal = red bold
oldHighlight = red bold 52
newNormal = green bold
newHighlight = green bold 22
[color "diff"]
meta = yellow
frag = magenta bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse
[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
[diff "zip"]
textconv = unzip -c -a
[diff "sopsdiffer"]
textconv = sops -d
[filter "lfs"]
smudge = git-lfs smudge -- %f
required = true
clean = git-lfs clean -- %f
[remote "origin"]
fetch = +refs/pull/*/head:refs/remotes/origin/pull/*
#[includeIf "gitdir:~/work/code/"]
# path = .gitconfig-nuxeo
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.