aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-05-27 19:29:15 +0800
committerAaron LI <aly@aaronly.me>2017-05-27 19:29:15 +0800
commite520ae6641377cb6c514de700e2d9653b3970766 (patch)
treed950861d979ea69dbaed8ecc636b1bdeebd1902f
parentdcdda70320fec12f45bc97d663a1e75c63c37b5a (diff)
downloaddotfiles-e520ae6641377cb6c514de700e2d9653b3970766.tar.bz2
gitconfig: Enable commit signing; add various aliases
Credit: https://gist.github.com/pksunkara/988716
-rw-r--r--_gitconfig177
1 files changed, 174 insertions, 3 deletions
diff --git a/_gitconfig b/_gitconfig
index 78316a6..f78dbc2 100644
--- a/_gitconfig
+++ b/_gitconfig
@@ -1,5 +1,176 @@
+#
+# ~/.gitconfig
+# User Git configuration file
+#
+# Credit:
+# * https://gist.github.com/pksunkara/988716
+#
+# Aaron LI
+# 2017-05-27
+#
+
[user]
- name = Aaron LI
- email = aaronly.me@outlook.com
+ name = Aaron LI
+ email = aly@aaronly.me
+ signingKey = aly@aaronly.me
+
[push]
- default = simple
+ default = simple
+
+[commit]
+ gpgSign = true
+
+[color]
+ ui = auto
+
+[alias]
+ a = add --all
+ ai = add -i
+ #############
+ ap = apply
+ as = apply --stat
+ ac = apply --check
+ #############
+ ama = am --abort
+ amr = am --resolved
+ ams = am --skip
+ #############
+ b = branch
+ ba = branch -a
+ bd = branch -d
+ br = branch -r
+ #############
+ c = commit
+ ca = commit -a
+ cm = commit -m
+ cem = commit --allow-empty -m
+ cam = commit -am
+ cd = commit --amend
+ cad = commit -a --amend
+ ced = commit --allow-empty --amend
+ #############
+ d = diff
+ dc = diff --cached
+ dl = difftool
+ dlc = difftool --cached
+ dk = diff --check
+ dp = diff --patience
+ dck = diff --cached --check
+ #############
+ f = fetch
+ fo = fetch origin
+ fu = fetch upstream
+ #############
+ fp = format-patch
+ #############
+ fk = fsck
+ #############
+ g = grep -p
+ #############
+ l = log --oneline
+ lg = log --oneline --graph --decorate
+ #############
+ ls = ls-files
+ lsf = "!git ls-files | grep -i"
+ #############
+ m = merge
+ ma = merge --abort
+ mc = merge --continue
+ ms = merge --skip
+ #############
+ o = checkout
+ ob = checkout -b
+ #############
+ pr = prune -v
+ #############
+ ps = push
+ psf = push -f
+ psu = push -u
+ pso = push origin
+ psao = push --all origin
+ psfo = push -f origin
+ psuo = push -u origin
+ psom = push origin master
+ psfom = push -f origin master
+ psuom = push -u origin master
+ #############
+ pl = pull
+ plu = pull -u
+ plo = pull origin
+ plp = pull upstream
+ plom = pull origin master
+ plpm = pull upstream master
+ #############
+ pb = pull --rebase
+ pbo = pull --rebase origin
+ pbp = pull --rebase upstream
+ pbom = pull --rebase origin master
+ pbpm = pull --rebase upstream master
+ #############
+ rb = rebase
+ rba = rebase --abort
+ rbc = rebase --continue
+ rbi = rebase --interactive
+ rbs = rebase --skip
+ #############
+ re = reset
+ rh = reset HEAD
+ reh = reset --hard
+ rem = reset --mixed
+ res = reset --soft
+ rehh = reset --hard HEAD
+ remh = reset --mixed HEAD
+ resh = reset --soft HEAD
+ #############
+ r = remote
+ ra = remote add
+ rr = remote rm
+ rv = remote -v
+ rm = remote rename
+ rp = remote prune
+ rs = remote show
+ rao = remote add origin
+ rau = remote add upstream
+ rso = remote show origin
+ rsu = remote show upstream
+ rpo = remote prune origin
+ rpu = remote prune upstream
+ #############
+ s = status
+ sb = status -s -b
+ #############
+ sa = stash apply
+ sc = stash clear
+ sd = stash drop
+ sl = stash list
+ sp = stash pop
+ ss = stash save
+ sw = stash show
+ #############
+ w = show
+ wp = show -p
+ wr = show -p --no-color
+ #############
+ svnr = svn rebase
+ svnd = svn dcommit
+ svnl = svn log --oneline --show-commit
+ #############
+ assume = update-index --assume-unchanged
+ unassume = update-index --no-assume-unchanged
+ assumed = "!git ls-files -v | grep ^h | cut -c 3-"
+ unassumeall = !git assumed | xargs git update-index --no-assume-unchanged
+ assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
+ #############
+ ours = "!f() { git checkout --ours $@ && git add $@; }; f"
+ theirs = "!f() { git checkout --theirs $@ && git add $@; }; f"
+ #############
+ whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
+ whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
+ #############
+ barebranch = !sh -c 'git symbolic-ref HEAD refs/heads/$1 && git rm --cached -r . && git clean -xfd' -
+ flat = clone --depth 1
+ subpull = !git submodule foreach git pull --tags origin master
+ subrepo = !sh -c 'filter-branch --prune-empty --subdirectory-filter $1 master' -
+ human = name-rev --name-only --refs=refs/heads/*
+ serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git
+ snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"