From 16ed3393e2acde29ef59860800f12d67ec0c4b14 Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Sun, 24 Jul 2016 11:25:36 -0500 Subject: [PATCH] Update git aliases. --- git.org | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/git.org b/git.org index a79cbad..b69423d 100644 --- a/git.org +++ b/git.org @@ -45,7 +45,7 @@ General git configuration split out into sections mostly. wd = diff --color-words fa = fetch --all ci = commit - ciu = commit --all + cia = commit --all co = checkout ds = diff --stat ba = branch --all @@ -61,6 +61,7 @@ General git configuration split out into sections mostly. ri = rebase --interactive --autosquash ra = rebase --abort effit = reset --hard + bn = rev-parse --abbrev-ref HEAD cp = log --no-merges --cherry --graph --oneline # What commits differ between branches, note, equivalent commits are omitted. # Use this with three dot operator aka master...origin/master @@ -68,14 +69,18 @@ General git configuration split out into sections mostly. # Same as ^ only equivalent commits are listed with a = sign. cmd = log --no-merges --left-right --graph --cherry-mark --oneline # git update with submodule update - sup = git pull --rebase && git submodule update --init --recursive + sup = !git pull --rebase && git submodule update --init --recursive # git clone with submodules sc = !git clone --recursive $1 # what files are getting updated a lot churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' # help the gc a bit and get a bit more space back for a local clone trim = !git reflog expire --expire=now --all && git gc --prune=now - aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort + defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' + short = rev-parse --short + find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" + show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" + pbr = !git push --set-upstream $(git defremote) $(git bnam) #+END_SRC ** github #+BEGIN_SRC conf :tangle (when (eq git-p t) "tmp/.gitconfig")