diff --git a/doc/git-a/alias.txt b/doc/git-a/alias.txt new file mode 100644 index 0000000..76d4bb8 --- /dev/null +++ b/doc/git-a/alias.txt @@ -0,0 +1 @@ +add diff --git a/doc/git-aa/alias.txt b/doc/git-aa/alias.txt new file mode 100644 index 0000000..7f9cb38 --- /dev/null +++ b/doc/git-aa/alias.txt @@ -0,0 +1 @@ +add --all diff --git a/doc/git-add-alias/alias.sh b/doc/git-add-alias/alias.sh new file mode 100644 index 0000000..bb5ea2c --- /dev/null +++ b/doc/git-add-alias/alias.sh @@ -0,0 +1 @@ +f() { if [ $# != 3 ]; then echo "Usage: git add-alias ( --local | --global ) "; echo "Error: this command needs 3 arguments."; return 2; fi; if [ -n "$(git config "$1" --get alias."$2")" ]; then echo "Alias '$2' already exists, thus no change happened."; return 3; fi; git config "$1" alias."$2" "$3" && return 0; echo "Usage: git add-alias ( --local | --global ) "; echo "Error: unknown failure."; return 1; }; f diff --git a/doc/git-add-cached/alias.sh b/doc/git-add-cached/alias.sh new file mode 100644 index 0000000..af83e32 --- /dev/null +++ b/doc/git-add-cached/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --cached | sort -u)" diff --git a/doc/git-add-deleted/alias.sh b/doc/git-add-deleted/alias.sh new file mode 100644 index 0000000..ca965f1 --- /dev/null +++ b/doc/git-add-deleted/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --deleted | sort -u)" diff --git a/doc/git-add-ignored/alias.sh b/doc/git-add-ignored/alias.sh new file mode 100644 index 0000000..b429d60 --- /dev/null +++ b/doc/git-add-ignored/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --ignored | sort -u)" diff --git a/doc/git-add-killed/alias.sh b/doc/git-add-killed/alias.sh new file mode 100644 index 0000000..2085c91 --- /dev/null +++ b/doc/git-add-killed/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --killed | sort -u)" diff --git a/doc/git-add-modified/alias.sh b/doc/git-add-modified/alias.sh new file mode 100644 index 0000000..987c29c --- /dev/null +++ b/doc/git-add-modified/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --modified | sort -u)" diff --git a/doc/git-add-others/alias.sh b/doc/git-add-others/alias.sh new file mode 100644 index 0000000..492f010 --- /dev/null +++ b/doc/git-add-others/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --others | sort -u)" diff --git a/doc/git-add-stage/alias.sh b/doc/git-add-stage/alias.sh new file mode 100644 index 0000000..64b7b7f --- /dev/null +++ b/doc/git-add-stage/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --stage | cut -f2 | sort -u)" diff --git a/doc/git-add-unmerged/alias.sh b/doc/git-add-unmerged/alias.sh new file mode 100644 index 0000000..f640767 --- /dev/null +++ b/doc/git-add-unmerged/alias.sh @@ -0,0 +1 @@ +git add "$(git ls-files --unmerged | cut -f2 | sort -u)" diff --git a/doc/git-alias/alias.sh b/doc/git-alias/alias.sh new file mode 100644 index 0000000..cce5251 --- /dev/null +++ b/doc/git-alias/alias.sh @@ -0,0 +1 @@ +f(){ echo "Git Alias is project that has a collection of git alias commands."; echo "The purpose is to help make git easier, faster, and more capable."; echo "Free open source repository ."; echo ""; echo "To see your existing git aliases:"; echo " git aliases"; echo ""; echo "To see your existing git aliases by using git directly:"; echo " git config --get-regexp ^alias\."; };f diff --git a/doc/git-aliases/alias.sh b/doc/git-aliases/alias.sh new file mode 100644 index 0000000..8b109e7 --- /dev/null +++ b/doc/git-aliases/alias.sh @@ -0,0 +1 @@ +git config --get-regexp '^alias\.' | cut -c 7- | sed 's/ / = /' diff --git a/doc/git-ap/alias.txt b/doc/git-ap/alias.txt new file mode 100644 index 0000000..a21923e --- /dev/null +++ b/doc/git-ap/alias.txt @@ -0,0 +1 @@ +add --patch diff --git a/doc/git-archive/alias.sh b/doc/git-archive/alias.sh new file mode 100644 index 0000000..e2deea6 --- /dev/null +++ b/doc/git-archive/alias.sh @@ -0,0 +1 @@ +f() { top="$(rev-parse --show-toplevel)"; cd "$top" || exit 1 ; tar cvf "$top.tar" "$top" ; }; f diff --git a/doc/git-assume-all/alias.sh b/doc/git-assume-all/alias.sh new file mode 100644 index 0000000..2a35c2a --- /dev/null +++ b/doc/git-assume-all/alias.sh @@ -0,0 +1 @@ +git st -s | awk '{ print $2 }' | xargs -r git assume diff --git a/doc/git-assume/alias.txt b/doc/git-assume/alias.txt new file mode 100644 index 0000000..d561643 --- /dev/null +++ b/doc/git-assume/alias.txt @@ -0,0 +1 @@ +update-index --assume-unchanged diff --git a/doc/git-assumed/alias.sh b/doc/git-assumed/alias.sh new file mode 100644 index 0000000..7a3fc56 --- /dev/null +++ b/doc/git-assumed/alias.sh @@ -0,0 +1 @@ +git ls-files -v | grep ^h | cut -c 3- diff --git a/doc/git-au/alias.txt b/doc/git-au/alias.txt new file mode 100644 index 0000000..d0ee5ed --- /dev/null +++ b/doc/git-au/alias.txt @@ -0,0 +1 @@ +add --update diff --git a/doc/git-b/alias.txt b/doc/git-b/alias.txt new file mode 100644 index 0000000..80858c1 --- /dev/null +++ b/doc/git-b/alias.txt @@ -0,0 +1 @@ +branch diff --git a/doc/git-bed/alias.txt b/doc/git-bed/alias.txt new file mode 100644 index 0000000..6851860 --- /dev/null +++ b/doc/git-bed/alias.txt @@ -0,0 +1 @@ +branch --edit-description diff --git a/doc/git-bm/alias.txt b/doc/git-bm/alias.txt new file mode 100644 index 0000000..b4573f6 --- /dev/null +++ b/doc/git-bm/alias.txt @@ -0,0 +1 @@ +branch --merged diff --git a/doc/git-bnm/alias.txt b/doc/git-bnm/alias.txt new file mode 100644 index 0000000..81a4d59 --- /dev/null +++ b/doc/git-bnm/alias.txt @@ -0,0 +1 @@ +branch --no-merged diff --git a/doc/git-branch-commit-first/alias.sh b/doc/git-branch-commit-first/alias.sh new file mode 100644 index 0000000..22b6e38 --- /dev/null +++ b/doc/git-branch-commit-first/alias.sh @@ -0,0 +1 @@ +f() { branch="${1:-$(git current-branch)}"; count="${2:-1}"; git log --reverse --pretty=%H "$branch" | head -"$count"; }; f diff --git a/doc/git-branch-commit-last/alias.sh b/doc/git-branch-commit-last/alias.sh new file mode 100644 index 0000000..fa479d7 --- /dev/null +++ b/doc/git-branch-commit-last/alias.sh @@ -0,0 +1 @@ +f() { branch="${1:-$(git current-branch)}"; count="${2:-1}"; git log --pretty=%H "$branch" | head -"$count"; }; f diff --git a/doc/git-branch-commit-next/alias.sh b/doc/git-branch-commit-next/alias.sh new file mode 100644 index 0000000..335d896 --- /dev/null +++ b/doc/git-branch-commit-next/alias.sh @@ -0,0 +1 @@ +f() { branch="${1:-$(git current-branch)}"; count="${2:-1}"; git log --reverse --pretty=%H "$branch" | grep -A "$count" "$(git rev-parse HEAD)" | tail +2; }; f diff --git a/doc/git-branch-commit-prev/alias.sh b/doc/git-branch-commit-prev/alias.sh new file mode 100644 index 0000000..8a2a382 --- /dev/null +++ b/doc/git-branch-commit-prev/alias.sh @@ -0,0 +1 @@ +f() { branch="${1:-$(git current-branch)}"; count="${2:-1}"; git log --pretty=%H "$branch" | grep -A "$count" "$(git rev-parse HEAD)" | tail +2; }; f diff --git a/doc/git-branches/alias.txt b/doc/git-branches/alias.txt new file mode 100644 index 0000000..da85c79 --- /dev/null +++ b/doc/git-branches/alias.txt @@ -0,0 +1 @@ +branch -a diff --git a/doc/git-bsd/alias.sh b/doc/git-bsd/alias.sh new file mode 100644 index 0000000..8527e00 --- /dev/null +++ b/doc/git-bsd/alias.sh @@ -0,0 +1 @@ +f(){ branch="${1:-$(git rev-parse --abbrev-ref HEAD 2>/dev/null)}"; git config "branch.$branch.description"; };f diff --git a/doc/git-bv/alias.txt b/doc/git-bv/alias.txt new file mode 100644 index 0000000..d5a51e6 --- /dev/null +++ b/doc/git-bv/alias.txt @@ -0,0 +1 @@ +branch --verbose diff --git a/doc/git-bvv/alias.txt b/doc/git-bvv/alias.txt new file mode 100644 index 0000000..54d5b63 --- /dev/null +++ b/doc/git-bvv/alias.txt @@ -0,0 +1 @@ +branch --verbose --verbose diff --git a/doc/git-c/alias.txt b/doc/git-c/alias.txt new file mode 100644 index 0000000..01f9a2a --- /dev/null +++ b/doc/git-c/alias.txt @@ -0,0 +1 @@ +commit diff --git a/doc/git-ca/alias.txt b/doc/git-ca/alias.txt new file mode 100644 index 0000000..d8c8e92 --- /dev/null +++ b/doc/git-ca/alias.txt @@ -0,0 +1 @@ +commit --amend diff --git a/doc/git-caa/alias.txt b/doc/git-caa/alias.txt new file mode 100644 index 0000000..063e2b3 --- /dev/null +++ b/doc/git-caa/alias.txt @@ -0,0 +1 @@ +commit --amend --all diff --git a/doc/git-caam/alias.txt b/doc/git-caam/alias.txt new file mode 100644 index 0000000..22e25a9 --- /dev/null +++ b/doc/git-caam/alias.txt @@ -0,0 +1 @@ +commit --amend --all --message diff --git a/doc/git-caane/alias.txt b/doc/git-caane/alias.txt new file mode 100644 index 0000000..a005cbd --- /dev/null +++ b/doc/git-caane/alias.txt @@ -0,0 +1 @@ +commit --amend --all --no-edit diff --git a/doc/git-cam/alias.txt b/doc/git-cam/alias.txt new file mode 100644 index 0000000..27e3d46 --- /dev/null +++ b/doc/git-cam/alias.txt @@ -0,0 +1 @@ +commit --amend --message diff --git a/doc/git-cane/alias.txt b/doc/git-cane/alias.txt new file mode 100644 index 0000000..82b10a3 --- /dev/null +++ b/doc/git-cane/alias.txt @@ -0,0 +1 @@ +commit --amend --no-edit diff --git a/doc/git-chart/alias.sh b/doc/git-chart/alias.sh new file mode 100644 index 0000000..9735976 --- /dev/null +++ b/doc/git-chart/alias.sh @@ -0,0 +1 @@ +f() { git log --format=oneline --format="%aE %at" --since=6-weeks-ago "$*" | awk ' function time_to_slot(t) { return strftime("%Y-%m-%d", t, true) } function count_to_char(i) { return (i > 0) ? ((i < 10) ? i : "X") : "." } BEGIN { time_min = systime(); time_max = 0; SECONDS_PER_DAY=86400; } { item = $1; time = 0 + $2; if (time > time_max){ time_max = time } else if (time < time_min){ time_min = time }; slot = time_to_slot(time); items[item]++; slots[slot]++; views[item, slot]++; } END{ printf("Chart time range %s to %s.\n", time_to_slot(time_min), time_to_slot(time_max)); time_max_add = time_max += SECONDS_PER_DAY; for(item in items){ row = ""; for(time = time_min; time < time_max_add; time += SECONDS_PER_DAY) { slot = time_to_slot(time); count = views[item, slot]; row = row count_to_char(count); } print row, item; } }'; }; f diff --git a/doc/git-cherry-pick-merge/alias.sh b/doc/git-cherry-pick-merge/alias.sh new file mode 100644 index 0000000..1ba8470 --- /dev/null +++ b/doc/git-cherry-pick-merge/alias.sh @@ -0,0 +1 @@ +sh -c 'git cherry-pick --no-commit --mainline 1 $0 && git log -1 --pretty=%P $0 | cut -b 42- > .git/MERGE_HEAD && git commit --verbose' diff --git a/doc/git-churn/alias.sh b/doc/git-churn/alias.sh new file mode 100644 index 0000000..fcb2bf4 --- /dev/null +++ b/doc/git-churn/alias.sh @@ -0,0 +1 @@ +f() { git log --all --find-copies --find-renames --name-only --format='format:' "$@" | awk 'NF{a[$0]++}END{for(i in a){print a[i], i}}' | sort -rn;};f diff --git a/doc/git-ci/alias.txt b/doc/git-ci/alias.txt new file mode 100644 index 0000000..987750c --- /dev/null +++ b/doc/git-ci/alias.txt @@ -0,0 +1 @@ +commit --interactive diff --git a/doc/git-cleaner/alias.txt b/doc/git-cleaner/alias.txt new file mode 100644 index 0000000..61c71f1 --- /dev/null +++ b/doc/git-cleaner/alias.txt @@ -0,0 +1 @@ +clean -dff diff --git a/doc/git-cleanest/alias.txt b/doc/git-cleanest/alias.txt new file mode 100644 index 0000000..45957b3 --- /dev/null +++ b/doc/git-cleanest/alias.txt @@ -0,0 +1 @@ +clean -dffx diff --git a/doc/git-cleanout/alias.sh b/doc/git-cleanout/alias.sh new file mode 100644 index 0000000..705d9c9 --- /dev/null +++ b/doc/git-cleanout/alias.sh @@ -0,0 +1 @@ +git clean -df && git checkout -- . diff --git a/doc/git-clone-lean/alias.txt b/doc/git-clone-lean/alias.txt new file mode 100644 index 0000000..f72f825 --- /dev/null +++ b/doc/git-clone-lean/alias.txt @@ -0,0 +1 @@ +clone --depth 1 --filter=combine:blob:none+tree:0 --no-checkout diff --git a/doc/git-cloner/alias.txt b/doc/git-cloner/alias.txt new file mode 100644 index 0000000..70dc2ff --- /dev/null +++ b/doc/git-cloner/alias.txt @@ -0,0 +1 @@ +clone --recursive diff --git a/doc/git-cm/alias.txt b/doc/git-cm/alias.txt new file mode 100644 index 0000000..5af9efc --- /dev/null +++ b/doc/git-cm/alias.txt @@ -0,0 +1 @@ +commit --message diff --git a/doc/git-co/alias.txt b/doc/git-co/alias.txt new file mode 100644 index 0000000..72c48c6 --- /dev/null +++ b/doc/git-co/alias.txt @@ -0,0 +1 @@ +checkout diff --git a/doc/git-cob/alias.txt b/doc/git-cob/alias.txt new file mode 100644 index 0000000..3dee3c9 --- /dev/null +++ b/doc/git-cob/alias.txt @@ -0,0 +1 @@ +checkout -b diff --git a/doc/git-commit-is-merge/alias.sh b/doc/git-commit-is-merge/alias.sh new file mode 100644 index 0000000..5821c2a --- /dev/null +++ b/doc/git-commit-is-merge/alias.sh @@ -0,0 +1 @@ +f(){ [ -n "$(git commit-parents "$*" | sed '0,/^parent /d')" ];};f diff --git a/doc/git-commit-message-key-lines/alias.sh b/doc/git-commit-message-key-lines/alias.sh new file mode 100644 index 0000000..18366d7 --- /dev/null +++ b/doc/git-commit-message-key-lines/alias.sh @@ -0,0 +1 @@ +f(){ echo "Commit: $1"; git log "$1" --format=fuller | grep "^[[:blank:]]*[[:alnum:]][-[:alnum:]]*:" | sed "s/^[[:blank:]]*//; s/:[[:blank:]]*/: /"; }; f diff --git a/doc/git-commit-parents/alias.sh b/doc/git-commit-parents/alias.sh new file mode 100644 index 0000000..8a9a7fb --- /dev/null +++ b/doc/git-commit-parents/alias.sh @@ -0,0 +1 @@ +f(){ git cat-file -p "${*:-HEAD}" | sed -n '/0/,/^ *$/{/^parent /p}'; };f diff --git a/doc/git-cong/alias.txt b/doc/git-cong/alias.txt new file mode 100644 index 0000000..5209a4e --- /dev/null +++ b/doc/git-cong/alias.txt @@ -0,0 +1 @@ +checkout --no-guess diff --git a/doc/git-cp/alias.txt b/doc/git-cp/alias.txt new file mode 100644 index 0000000..24ca8d6 --- /dev/null +++ b/doc/git-cp/alias.txt @@ -0,0 +1 @@ +cherry-pick diff --git a/doc/git-cpa/alias.txt b/doc/git-cpa/alias.txt new file mode 100644 index 0000000..4b7f24f --- /dev/null +++ b/doc/git-cpa/alias.txt @@ -0,0 +1 @@ +cherry-pick --abort diff --git a/doc/git-cpc/alias.txt b/doc/git-cpc/alias.txt new file mode 100644 index 0000000..b004ff1 --- /dev/null +++ b/doc/git-cpc/alias.txt @@ -0,0 +1 @@ +cherry-pick --continue diff --git a/doc/git-cpn/alias.txt b/doc/git-cpn/alias.txt new file mode 100644 index 0000000..7c490cd --- /dev/null +++ b/doc/git-cpn/alias.txt @@ -0,0 +1 @@ +cherry-pick -n diff --git a/doc/git-cpnx/alias.txt b/doc/git-cpnx/alias.txt new file mode 100644 index 0000000..9397517 --- /dev/null +++ b/doc/git-cpnx/alias.txt @@ -0,0 +1 @@ +cherry-pick -n -x diff --git a/doc/git-current-branch/alias.txt b/doc/git-current-branch/alias.txt new file mode 100644 index 0000000..65bb5e0 --- /dev/null +++ b/doc/git-current-branch/alias.txt @@ -0,0 +1 @@ +rev-parse --abbrev-ref HEAD diff --git a/doc/git-cvs-e/alias.txt b/doc/git-cvs-e/alias.txt new file mode 100644 index 0000000..27c5928 --- /dev/null +++ b/doc/git-cvs-e/alias.txt @@ -0,0 +1 @@ +cvsexportcommit -u -p diff --git a/doc/git-cvs-i/alias.txt b/doc/git-cvs-i/alias.txt new file mode 100644 index 0000000..8c63c76 --- /dev/null +++ b/doc/git-cvs-i/alias.txt @@ -0,0 +1 @@ +cvsimport -k -a diff --git a/doc/git-d/alias.txt b/doc/git-d/alias.txt new file mode 100644 index 0000000..e779424 --- /dev/null +++ b/doc/git-d/alias.txt @@ -0,0 +1 @@ +diff diff --git a/doc/git-dc/alias.txt b/doc/git-dc/alias.txt new file mode 100644 index 0000000..8531918 --- /dev/null +++ b/doc/git-dc/alias.txt @@ -0,0 +1 @@ +diff --cached diff --git a/doc/git-dd/alias.txt b/doc/git-dd/alias.txt new file mode 100644 index 0000000..4575288 --- /dev/null +++ b/doc/git-dd/alias.txt @@ -0,0 +1 @@ +diff-deep diff --git a/doc/git-debug/alias.sh b/doc/git-debug/alias.sh new file mode 100644 index 0000000..4f1f89f --- /dev/null +++ b/doc/git-debug/alias.sh @@ -0,0 +1 @@ +GIT_PAGER='' gdb --args git diff --git a/doc/git-default-branch/alias.txt b/doc/git-default-branch/alias.txt new file mode 100644 index 0000000..196d68d --- /dev/null +++ b/doc/git-default-branch/alias.txt @@ -0,0 +1 @@ +config init.defaultBranch diff --git a/doc/git-diff-all/alias.sh b/doc/git-diff-all/alias.sh new file mode 100644 index 0000000..d9f027f --- /dev/null +++ b/doc/git-diff-all/alias.sh @@ -0,0 +1 @@ +for name in $(git diff --name-only "$1"); do git difftool "$1" "$name" & done diff --git a/doc/git-diff-changes/alias.txt b/doc/git-diff-changes/alias.txt new file mode 100644 index 0000000..b39e596 --- /dev/null +++ b/doc/git-diff-changes/alias.txt @@ -0,0 +1 @@ +diff --name-status -r diff --git a/doc/git-diff-chunk/alias.sh b/doc/git-diff-chunk/alias.sh new file mode 100644 index 0000000..067911e --- /dev/null +++ b/doc/git-diff-chunk/alias.sh @@ -0,0 +1 @@ +f() { git show "$1:$3" | sed -n "/^[^ ].*$4(/,/^}/p" > .tmp1 ; git show "$2:$3" | sed -n "/^[^ ].*$4(/,/^}/p" > .tmp2 ; git diff --no-index .tmp1 .tmp2 ; }; f diff --git a/doc/git-diff-deep/alias.txt b/doc/git-diff-deep/alias.txt new file mode 100644 index 0000000..311d083 --- /dev/null +++ b/doc/git-diff-deep/alias.txt @@ -0,0 +1 @@ +diff --check --dirstat --find-copies --find-renames --histogram --color diff --git a/doc/git-diff-staged/alias.txt b/doc/git-diff-staged/alias.txt new file mode 100644 index 0000000..8531918 --- /dev/null +++ b/doc/git-diff-staged/alias.txt @@ -0,0 +1 @@ +diff --cached diff --git a/doc/git-diff-stat/alias.txt b/doc/git-diff-stat/alias.txt new file mode 100644 index 0000000..619ba14 --- /dev/null +++ b/doc/git-diff-stat/alias.txt @@ -0,0 +1 @@ +diff --stat --ignore-space-change -r diff --git a/doc/git-discard/alias.txt b/doc/git-discard/alias.txt new file mode 100644 index 0000000..f8b34e7 --- /dev/null +++ b/doc/git-discard/alias.txt @@ -0,0 +1 @@ +checkout -- diff --git a/doc/git-ds/alias.txt b/doc/git-ds/alias.txt new file mode 100644 index 0000000..258ba16 --- /dev/null +++ b/doc/git-ds/alias.txt @@ -0,0 +1 @@ +diff --staged diff --git a/doc/git-dw/alias.txt b/doc/git-dw/alias.txt new file mode 100644 index 0000000..7f4e695 --- /dev/null +++ b/doc/git-dw/alias.txt @@ -0,0 +1 @@ +diff --word-diff diff --git a/doc/git-edit-cached/alias.sh b/doc/git-edit-cached/alias.sh new file mode 100644 index 0000000..d2d4c21 --- /dev/null +++ b/doc/git-edit-cached/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --cached | sort -u)" diff --git a/doc/git-edit-deleted/alias.sh b/doc/git-edit-deleted/alias.sh new file mode 100644 index 0000000..b75c56b --- /dev/null +++ b/doc/git-edit-deleted/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --deleted | sort -u)" diff --git a/doc/git-edit-ignored/alias.sh b/doc/git-edit-ignored/alias.sh new file mode 100644 index 0000000..93e395d --- /dev/null +++ b/doc/git-edit-ignored/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --ignored | sort -u)" diff --git a/doc/git-edit-killed/alias.sh b/doc/git-edit-killed/alias.sh new file mode 100644 index 0000000..38e92ad --- /dev/null +++ b/doc/git-edit-killed/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --killed | sort -u)" diff --git a/doc/git-edit-modified/alias.sh b/doc/git-edit-modified/alias.sh new file mode 100644 index 0000000..9901395 --- /dev/null +++ b/doc/git-edit-modified/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --modified | sort -u)" diff --git a/doc/git-edit-others/alias.sh b/doc/git-edit-others/alias.sh new file mode 100644 index 0000000..1b15635 --- /dev/null +++ b/doc/git-edit-others/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --others | sort -u)" diff --git a/doc/git-edit-stage/alias.sh b/doc/git-edit-stage/alias.sh new file mode 100644 index 0000000..1598b20 --- /dev/null +++ b/doc/git-edit-stage/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --stage | cut -f2 | sort -u)" diff --git a/doc/git-edit-unmerged/alias.sh b/doc/git-edit-unmerged/alias.sh new file mode 100644 index 0000000..2d044a4 --- /dev/null +++ b/doc/git-edit-unmerged/alias.sh @@ -0,0 +1 @@ +$(git var GIT_EDITOR) "$(git ls-files --unmerged | cut -f2 | sort -u)" diff --git a/doc/git-exec/alias.sh b/doc/git-exec/alias.sh new file mode 100644 index 0000000..a6b944a --- /dev/null +++ b/doc/git-exec/alias.sh @@ -0,0 +1 @@ + exec diff --git a/doc/git-expunge/alias.sh b/doc/git-expunge/alias.sh new file mode 100644 index 0000000..5ff5986 --- /dev/null +++ b/doc/git-expunge/alias.sh @@ -0,0 +1 @@ +f() { git filter-branch --force --index-filter "git rm --cached --ignore-unmatch $1" --prune-empty --tag-name-filter "cat" -- --all ; }; f diff --git a/doc/git-f/alias.txt b/doc/git-f/alias.txt new file mode 100644 index 0000000..bad6ace --- /dev/null +++ b/doc/git-f/alias.txt @@ -0,0 +1 @@ +fetch diff --git a/doc/git-fa/alias.txt b/doc/git-fa/alias.txt new file mode 100644 index 0000000..8bd0911 --- /dev/null +++ b/doc/git-fa/alias.txt @@ -0,0 +1 @@ +fetch --all diff --git a/doc/git-fav/alias.txt b/doc/git-fav/alias.txt new file mode 100644 index 0000000..5ae353d --- /dev/null +++ b/doc/git-fav/alias.txt @@ -0,0 +1 @@ +fetch --all --verbose diff --git a/doc/git-fixup/alias.sh b/doc/git-fixup/alias.sh new file mode 100644 index 0000000..7f70419 --- /dev/null +++ b/doc/git-fixup/alias.sh @@ -0,0 +1 @@ +f() { TARGET="$(git rev-parse "$1")"; git commit --fixup="$TARGET" && GIT_EDITOR=true git rebase --interactive --autosquash "$TARGET"~; }; f diff --git a/doc/git-g/alias.txt b/doc/git-g/alias.txt new file mode 100644 index 0000000..bdbac16 --- /dev/null +++ b/doc/git-g/alias.txt @@ -0,0 +1 @@ +grep diff --git a/doc/git-get/alias.sh b/doc/git-get/alias.sh new file mode 100644 index 0000000..d4a022d --- /dev/null +++ b/doc/git-get/alias.sh @@ -0,0 +1 @@ +git fetch --prune && git pull --rebase && git submodule update --init --recursive diff --git a/doc/git-gg/alias.txt b/doc/git-gg/alias.txt new file mode 100644 index 0000000..9788d8d --- /dev/null +++ b/doc/git-gg/alias.txt @@ -0,0 +1 @@ +grep-group diff --git a/doc/git-gitk-conflict/alias.sh b/doc/git-gitk-conflict/alias.sh new file mode 100644 index 0000000..0d00da1 --- /dev/null +++ b/doc/git-gitk-conflict/alias.sh @@ -0,0 +1 @@ +gitk --left-right HEAD...MERGE_HEAD diff --git a/doc/git-gitk-history-all/alias.sh b/doc/git-gitk-history-all/alias.sh new file mode 100644 index 0000000..b026602 --- /dev/null +++ b/doc/git-gitk-history-all/alias.sh @@ -0,0 +1 @@ +gitk --all "$(git fsck | awk '/dangling commit/ {print $3}')" diff --git a/doc/git-gn/alias.txt b/doc/git-gn/alias.txt new file mode 100644 index 0000000..94f5ec9 --- /dev/null +++ b/doc/git-gn/alias.txt @@ -0,0 +1 @@ +grep -n diff --git a/doc/git-graphviz/alias.sh b/doc/git-graphviz/alias.sh new file mode 100644 index 0000000..4ed272a --- /dev/null +++ b/doc/git-graphviz/alias.sh @@ -0,0 +1 @@ +f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' "$@" | sed 's/[0-9a-f][0-9a-f]*/"&"/g' ; echo '}'; }; f diff --git a/doc/git-grep-ack/alias.txt b/doc/git-grep-ack/alias.txt new file mode 100644 index 0000000..7a26b8e --- /dev/null +++ b/doc/git-grep-ack/alias.txt @@ -0,0 +1 @@ +-c color.grep.linenumber="bold yellow" -c color.grep.filename="bold green" -c color.grep.match="reverse yellow" grep --break --heading --line-number diff --git a/doc/git-grep-all/alias.sh b/doc/git-grep-all/alias.sh new file mode 100644 index 0000000..a5a8aaf --- /dev/null +++ b/doc/git-grep-all/alias.sh @@ -0,0 +1 @@ +f() { git rev-list --all | xargs git grep "$@"; }; f diff --git a/doc/git-grep-group/alias.txt b/doc/git-grep-group/alias.txt new file mode 100644 index 0000000..deac0c6 --- /dev/null +++ b/doc/git-grep-group/alias.txt @@ -0,0 +1 @@ +grep --break --heading --line-number --color diff --git a/doc/git-heads/alias.sh b/doc/git-heads/alias.sh new file mode 100644 index 0000000..1995844 --- /dev/null +++ b/doc/git-heads/alias.sh @@ -0,0 +1 @@ +git log origin/main.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';' diff --git a/doc/git-hew-dry-run/alias.sh b/doc/git-hew-dry-run/alias.sh new file mode 100644 index 0000000..8a411bb --- /dev/null +++ b/doc/git-hew-dry-run/alias.sh @@ -0,0 +1 @@ +git hew-local-dry-run "$@" && git hew-remote-dry-run "$@" # diff --git a/doc/git-hew-local-dry-run/alias.sh b/doc/git-hew-local-dry-run/alias.sh new file mode 100644 index 0000000..60618c0 --- /dev/null +++ b/doc/git-hew-local-dry-run/alias.sh @@ -0,0 +1 @@ +f() { commit=${1:-$(git current-branch)}; git branch --merged "$commit" | grep -v "^[[:space:]]*\*[[:space:]]*$commit$" ; }; f "$@" diff --git a/doc/git-hew-local/alias.sh b/doc/git-hew-local/alias.sh new file mode 100644 index 0000000..30fee6c --- /dev/null +++ b/doc/git-hew-local/alias.sh @@ -0,0 +1 @@ +f() { git hew-local-dry-run "$@" | xargs git branch --delete ; }; f "$@" diff --git a/doc/git-hew-remote-dry-run/alias.sh b/doc/git-hew-remote-dry-run/alias.sh new file mode 100644 index 0000000..3e406db --- /dev/null +++ b/doc/git-hew-remote-dry-run/alias.sh @@ -0,0 +1 @@ +f() { commit=${1:-$(git upstream-branch)}; git branch --remotes --merged "$commit" | grep -v "^[[:space:]]*origin/$commit$" | sed 's#[[:space:]]*origin/##' ; }; f "$@" diff --git a/doc/git-hew-remote/alias.sh b/doc/git-hew-remote/alias.sh new file mode 100644 index 0000000..1e6b5e3 --- /dev/null +++ b/doc/git-hew-remote/alias.sh @@ -0,0 +1 @@ +f() { git hew-remote-dry-run "$@" | xargs -I% git push origin :% 2>&1 ; }; f "$@" diff --git a/doc/git-hew/alias.sh b/doc/git-hew/alias.sh new file mode 100644 index 0000000..8bb70d6 --- /dev/null +++ b/doc/git-hew/alias.sh @@ -0,0 +1 @@ +git hew-local "$@" && git hew-remote "$@" # diff --git a/doc/git-ignore/alias.sh b/doc/git-ignore/alias.sh new file mode 100644 index 0000000..4b9bdc8 --- /dev/null +++ b/doc/git-ignore/alias.sh @@ -0,0 +1 @@ +git status | grep -P "^\t" | grep -vF .gitignore | sed "s/^\t//" >> .gitignore diff --git a/doc/git-inbound/alias.sh b/doc/git-inbound/alias.sh new file mode 100644 index 0000000..4b689a7 --- /dev/null +++ b/doc/git-inbound/alias.sh @@ -0,0 +1 @@ +git remote update --prune diff --git a/doc/git-init-empty/alias.sh b/doc/git-init-empty/alias.sh new file mode 100644 index 0000000..bdeec4b --- /dev/null +++ b/doc/git-init-empty/alias.sh @@ -0,0 +1 @@ +f() { git init && git commit --allow-empty --allow-empty-message --message ''; }; f diff --git a/doc/git-initer/alias.txt b/doc/git-initer/alias.txt new file mode 100644 index 0000000..11a098a --- /dev/null +++ b/doc/git-initer/alias.txt @@ -0,0 +1 @@ +init-empty diff --git a/doc/git-intercommit/alias.sh b/doc/git-intercommit/alias.sh new file mode 100644 index 0000000..3453f8c --- /dev/null +++ b/doc/git-intercommit/alias.sh @@ -0,0 +1 @@ +sh -c 'git show $1 > .git/commit1 && git show $2 > .git/commit2 && interdiff .git/commit[12] | less -FRS' - diff --git a/doc/git-issues/alias.sh b/doc/git-issues/alias.sh new file mode 100644 index 0000000..34090e2 --- /dev/null +++ b/doc/git-issues/alias.sh @@ -0,0 +1 @@ +sh -c "git log $1 --oneline | grep -o \"ISSUE-[0-9]\+\" | sort -u" diff --git a/doc/git-l/alias.txt b/doc/git-l/alias.txt new file mode 100644 index 0000000..6bfe6b1 --- /dev/null +++ b/doc/git-l/alias.txt @@ -0,0 +1 @@ +log diff --git a/doc/git-last-tag/alias.txt b/doc/git-last-tag/alias.txt new file mode 100644 index 0000000..d27adb6 --- /dev/null +++ b/doc/git-last-tag/alias.txt @@ -0,0 +1 @@ +describe --tags --abbrev=0 diff --git a/doc/git-last-tagged/alias.sh b/doc/git-last-tagged/alias.sh new file mode 100644 index 0000000..9ce058c --- /dev/null +++ b/doc/git-last-tagged/alias.sh @@ -0,0 +1 @@ +git describe --tags "$(git rev-list --tags --max-count=1)" diff --git a/doc/git-lfp/alias.txt b/doc/git-lfp/alias.txt new file mode 100644 index 0000000..7ae9865 --- /dev/null +++ b/doc/git-lfp/alias.txt @@ -0,0 +1 @@ +log --first-parent diff --git a/doc/git-lg/alias.txt b/doc/git-lg/alias.txt new file mode 100644 index 0000000..0236882 --- /dev/null +++ b/doc/git-lg/alias.txt @@ -0,0 +1 @@ +log --graph diff --git a/doc/git-ll/alias.txt b/doc/git-ll/alias.txt new file mode 100644 index 0000000..c6e1c83 --- /dev/null +++ b/doc/git-ll/alias.txt @@ -0,0 +1 @@ +log-list diff --git a/doc/git-lll/alias.txt b/doc/git-lll/alias.txt new file mode 100644 index 0000000..06d7a21 --- /dev/null +++ b/doc/git-lll/alias.txt @@ -0,0 +1 @@ +log-list-long diff --git a/doc/git-lo/alias.txt b/doc/git-lo/alias.txt new file mode 100644 index 0000000..bc6fdf4 --- /dev/null +++ b/doc/git-lo/alias.txt @@ -0,0 +1 @@ +log --oneline diff --git a/doc/git-log-1-day/alias.txt b/doc/git-log-1-day/alias.txt new file mode 100644 index 0000000..3d71069 --- /dev/null +++ b/doc/git-log-1-day/alias.txt @@ -0,0 +1 @@ +log --since=1-day-ago diff --git a/doc/git-log-1-hour/alias.txt b/doc/git-log-1-hour/alias.txt new file mode 100644 index 0000000..0f0179c --- /dev/null +++ b/doc/git-log-1-hour/alias.txt @@ -0,0 +1 @@ +log --since=1-hour-ago diff --git a/doc/git-log-1-month/alias.txt b/doc/git-log-1-month/alias.txt new file mode 100644 index 0000000..9250c2c --- /dev/null +++ b/doc/git-log-1-month/alias.txt @@ -0,0 +1 @@ +log --since=1-month-ago diff --git a/doc/git-log-1-week/alias.txt b/doc/git-log-1-week/alias.txt new file mode 100644 index 0000000..ba47156 --- /dev/null +++ b/doc/git-log-1-week/alias.txt @@ -0,0 +1 @@ +log --since=1-week-ago diff --git a/doc/git-log-1-year/alias.txt b/doc/git-log-1-year/alias.txt new file mode 100644 index 0000000..1e893ea --- /dev/null +++ b/doc/git-log-1-year/alias.txt @@ -0,0 +1 @@ +log --since=1-year-ago diff --git a/doc/git-log-date-first/alias.sh b/doc/git-log-date-first/alias.sh new file mode 100644 index 0000000..e591107 --- /dev/null +++ b/doc/git-log-date-first/alias.sh @@ -0,0 +1 @@ +git log --date-order --format=%cI | tail -1 diff --git a/doc/git-log-date-last/alias.txt b/doc/git-log-date-last/alias.txt new file mode 100644 index 0000000..95ab006 --- /dev/null +++ b/doc/git-log-date-last/alias.txt @@ -0,0 +1 @@ +log -1 --date-order --format=%cI diff --git a/doc/git-log-fetched/alias.txt b/doc/git-log-fetched/alias.txt new file mode 100644 index 0000000..0942cc4 --- /dev/null +++ b/doc/git-log-fetched/alias.txt @@ -0,0 +1 @@ +log --oneline HEAD..origin/main diff --git a/doc/git-log-fresh/alias.txt b/doc/git-log-fresh/alias.txt new file mode 100644 index 0000000..1c3b9c9 --- /dev/null +++ b/doc/git-log-fresh/alias.txt @@ -0,0 +1 @@ +log ORIG_HEAD.. --stat --no-merges diff --git a/doc/git-log-graph/alias.txt b/doc/git-log-graph/alias.txt new file mode 100644 index 0000000..26d5e2e --- /dev/null +++ b/doc/git-log-graph/alias.txt @@ -0,0 +1 @@ +log --graph --all --oneline --decorate diff --git a/doc/git-log-list-long/alias.txt b/doc/git-log-list-long/alias.txt new file mode 100644 index 0000000..f8bbf08 --- /dev/null +++ b/doc/git-log-list-long/alias.txt @@ -0,0 +1 @@ +log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:'%Cblue%ad %C(auto)%h%Creset -%C(auto)%d%Creset %s %Cblue[%aN <%aE>]%Creset %Cblue%G?%Creset' diff --git a/doc/git-log-list/alias.txt b/doc/git-log-list/alias.txt new file mode 100644 index 0000000..5e1361c --- /dev/null +++ b/doc/git-log-list/alias.txt @@ -0,0 +1 @@ +log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:'%Cblue%ad %C(auto)%h%Creset -%C(auto)%d%Creset %s %Cblue[%aN]%Creset %Cblue%G?%Creset' diff --git a/doc/git-log-local/alias.txt b/doc/git-log-local/alias.txt new file mode 100644 index 0000000..02616ad --- /dev/null +++ b/doc/git-log-local/alias.txt @@ -0,0 +1 @@ +log --oneline origin..HEAD diff --git a/doc/git-log-local/index.md b/doc/git-log-local/index.md new file mode 100644 index 0000000..afb2050 --- /dev/null +++ b/doc/git-log-local/index.md @@ -0,0 +1,3 @@ +# git log-local + + diff --git a/doc/git-log-my-day/alias.sh b/doc/git-log-my-day/alias.sh new file mode 100644 index 0000000..4c3ca9c --- /dev/null +++ b/doc/git-log-my-day/alias.sh @@ -0,0 +1 @@ +git log --author "$(git config user.email)" --since=1-day-ago diff --git a/doc/git-log-my-hour/alias.sh b/doc/git-log-my-hour/alias.sh new file mode 100644 index 0000000..e025795 --- /dev/null +++ b/doc/git-log-my-hour/alias.sh @@ -0,0 +1 @@ +git log --author "$(git config user.email)" --since=1-hour-ago diff --git a/doc/git-log-my-month/alias.sh b/doc/git-log-my-month/alias.sh new file mode 100644 index 0000000..a37ae08 --- /dev/null +++ b/doc/git-log-my-month/alias.sh @@ -0,0 +1 @@ +git log --author "$(git config user.email)" --since=1-month-ago diff --git a/doc/git-log-my-week/alias.sh b/doc/git-log-my-week/alias.sh new file mode 100644 index 0000000..dbe5d5d --- /dev/null +++ b/doc/git-log-my-week/alias.sh @@ -0,0 +1 @@ +git log --author "$(git config user.email)" --since=1-week-ago diff --git a/doc/git-log-my-year/alias.sh b/doc/git-log-my-year/alias.sh new file mode 100644 index 0000000..f5a7afd --- /dev/null +++ b/doc/git-log-my-year/alias.sh @@ -0,0 +1 @@ +git log --author "$(git config user.email)" --since=1-year-ago diff --git a/doc/git-log-my/alias.sh b/doc/git-log-my/alias.sh new file mode 100644 index 0000000..308c034 --- /dev/null +++ b/doc/git-log-my/alias.sh @@ -0,0 +1 @@ +git log --author "$(git config user.email)" diff --git a/doc/git-log-of-count-and-day-of-week/alias.sh b/doc/git-log-of-count-and-day-of-week/alias.sh new file mode 100644 index 0000000..7b53a8e --- /dev/null +++ b/doc/git-log-of-count-and-day-of-week/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%u" "$@"; }; f diff --git a/doc/git-log-of-count-and-day/alias.sh b/doc/git-log-of-count-and-day/alias.sh new file mode 100644 index 0000000..bf2967d --- /dev/null +++ b/doc/git-log-of-count-and-day/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%Y-%m-%d" "$@" ; }; f diff --git a/doc/git-log-of-count-and-email/alias.sh b/doc/git-log-of-count-and-email/alias.sh new file mode 100644 index 0000000..95bd834 --- /dev/null +++ b/doc/git-log-of-count-and-email/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format "%aE" "$@"; }; f diff --git a/doc/git-log-of-count-and-format-with-date/alias.sh b/doc/git-log-of-count-and-format-with-date/alias.sh new file mode 100644 index 0000000..429f0cf --- /dev/null +++ b/doc/git-log-of-count-and-format-with-date/alias.sh @@ -0,0 +1 @@ +f() { format="$1"; shift; date_format="$1"; shift; git log "$@" --format=oneline --format="$format" --date=format:"$date_format" | awk '{a[$0]++}END{for(i in a){print a[i], int((a[i]/NR)*100) "%", i}}' | sort -nr; }; f diff --git a/doc/git-log-of-count-and-format/alias.sh b/doc/git-log-of-count-and-format/alias.sh new file mode 100644 index 0000000..2e27f3e --- /dev/null +++ b/doc/git-log-of-count-and-format/alias.sh @@ -0,0 +1 @@ +f() { format="$1"; shift; git log "$@" --format=oneline --format="$format" | awk '{a[$0]++}END{for(i in a){print a[i], int((a[i]/NR)*100) "%", i}}' | sort -nr; }; f diff --git a/doc/git-log-of-count-and-hour-of-day/alias.sh b/doc/git-log-of-count-and-hour-of-day/alias.sh new file mode 100644 index 0000000..cfa3fb8 --- /dev/null +++ b/doc/git-log-of-count-and-hour-of-day/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%H" "$@"; }; f diff --git a/doc/git-log-of-count-and-hour/alias.sh b/doc/git-log-of-count-and-hour/alias.sh new file mode 100644 index 0000000..a0e970f --- /dev/null +++ b/doc/git-log-of-count-and-hour/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%Y-%m-%dT%H" "$@" ; }; f diff --git a/doc/git-log-of-count-and-month/alias.sh b/doc/git-log-of-count-and-month/alias.sh new file mode 100644 index 0000000..f5821cc --- /dev/null +++ b/doc/git-log-of-count-and-month/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%Y-%m" "$@" ; }; f diff --git a/doc/git-log-of-count-and-week-of-year/alias.sh b/doc/git-log-of-count-and-week-of-year/alias.sh new file mode 100644 index 0000000..fc6cb67 --- /dev/null +++ b/doc/git-log-of-count-and-week-of-year/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%V" "$@"; }; f diff --git a/doc/git-log-of-count-and-week/alias.sh b/doc/git-log-of-count-and-week/alias.sh new file mode 100644 index 0000000..d64634a --- /dev/null +++ b/doc/git-log-of-count-and-week/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%Y#%V" "$@"; }; f diff --git a/doc/git-log-of-count-and-year/alias.sh b/doc/git-log-of-count-and-year/alias.sh new file mode 100644 index 0000000..4857e32 --- /dev/null +++ b/doc/git-log-of-count-and-year/alias.sh @@ -0,0 +1 @@ +f() { git log-of-count-and-format-with-date "%ad" "%Y" "$@" ; }; f diff --git a/doc/git-log-of-day-and-count/alias.sh b/doc/git-log-of-day-and-count/alias.sh new file mode 100644 index 0000000..307882e --- /dev/null +++ b/doc/git-log-of-day-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%Y-%m-%d" "$@" ; }; f diff --git a/doc/git-log-of-day-of-week-and-count/alias.sh b/doc/git-log-of-day-of-week-and-count/alias.sh new file mode 100644 index 0000000..4b325aa --- /dev/null +++ b/doc/git-log-of-day-of-week-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%u" "$@"; }; f diff --git a/doc/git-log-of-email-and-count/alias.sh b/doc/git-log-of-email-and-count/alias.sh new file mode 100644 index 0000000..89d5f10 --- /dev/null +++ b/doc/git-log-of-email-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count "%aE" "$@"; }; f diff --git a/doc/git-log-of-format-and-count-with-date/alias.sh b/doc/git-log-of-format-and-count-with-date/alias.sh new file mode 100644 index 0000000..f2a79ac --- /dev/null +++ b/doc/git-log-of-format-and-count-with-date/alias.sh @@ -0,0 +1 @@ +f() { format="$1"; shift; date_format="$1"; shift; git log "$@" --format=oneline --format="$format" --date=format:"$date_format" | awk '{a[$0]++}END{for(i in a){print i, a[i], int((a[i]/NR)*100) "%"}}' | sort -r; }; f diff --git a/doc/git-log-of-format-and-count/alias.sh b/doc/git-log-of-format-and-count/alias.sh new file mode 100644 index 0000000..55e063f --- /dev/null +++ b/doc/git-log-of-format-and-count/alias.sh @@ -0,0 +1 @@ +f() { format="$1"; shift; git log "$@" --format=oneline --format="$format" | awk '{a[$0]++}END{for(i in a){print i, a[i], int((a[i]/NR)*100) "%"}}' | sort; }; f diff --git a/doc/git-log-of-hour-and-count/alias.sh b/doc/git-log-of-hour-and-count/alias.sh new file mode 100644 index 0000000..66d85b9 --- /dev/null +++ b/doc/git-log-of-hour-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%Y-%m-%dT%H" "$@" ; }; f diff --git a/doc/git-log-of-hour-of-day-and-count/alias.sh b/doc/git-log-of-hour-of-day-and-count/alias.sh new file mode 100644 index 0000000..7fd6069 --- /dev/null +++ b/doc/git-log-of-hour-of-day-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%H" "$@"; }; f diff --git a/doc/git-log-of-month-and-count/alias.sh b/doc/git-log-of-month-and-count/alias.sh new file mode 100644 index 0000000..afbb247 --- /dev/null +++ b/doc/git-log-of-month-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%Y-%m" "$@" ; }; f diff --git a/doc/git-log-of-week-and-count/alias.sh b/doc/git-log-of-week-and-count/alias.sh new file mode 100644 index 0000000..bd30325 --- /dev/null +++ b/doc/git-log-of-week-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%Y#%V" "$@"; }; f diff --git a/doc/git-log-of-week-of-year-and-count/alias.sh b/doc/git-log-of-week-of-year-and-count/alias.sh new file mode 100644 index 0000000..283ceda --- /dev/null +++ b/doc/git-log-of-week-of-year-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%V" "$@"; }; f diff --git a/doc/git-log-of-year-and-count/alias.sh b/doc/git-log-of-year-and-count/alias.sh new file mode 100644 index 0000000..f82b333 --- /dev/null +++ b/doc/git-log-of-year-and-count/alias.sh @@ -0,0 +1 @@ +f() { git log-of-format-and-count-with-date "%ad" "%Y" "$@" ; }; f diff --git a/doc/git-log-refs/alias.txt b/doc/git-log-refs/alias.txt new file mode 100644 index 0000000..acd766b --- /dev/null +++ b/doc/git-log-refs/alias.txt @@ -0,0 +1 @@ +log --all --graph --decorate --oneline --simplify-by-decoration --no-merges diff --git a/doc/git-log-timeline/alias.txt b/doc/git-log-timeline/alias.txt new file mode 100644 index 0000000..b36d378 --- /dev/null +++ b/doc/git-log-timeline/alias.txt @@ -0,0 +1 @@ +log --format='%h %an %ar - %s' diff --git a/doc/git-lor/alias.txt b/doc/git-lor/alias.txt new file mode 100644 index 0000000..889af0d --- /dev/null +++ b/doc/git-lor/alias.txt @@ -0,0 +1 @@ +log --oneline --reverse diff --git a/doc/git-lp/alias.txt b/doc/git-lp/alias.txt new file mode 100644 index 0000000..73a2e13 --- /dev/null +++ b/doc/git-lp/alias.txt @@ -0,0 +1 @@ +log --patch diff --git a/doc/git-ls/alias.txt b/doc/git-ls/alias.txt new file mode 100644 index 0000000..88ac81a --- /dev/null +++ b/doc/git-ls/alias.txt @@ -0,0 +1 @@ +ls-files diff --git a/doc/git-lsd/alias.txt b/doc/git-lsd/alias.txt new file mode 100644 index 0000000..58eda6c --- /dev/null +++ b/doc/git-lsd/alias.txt @@ -0,0 +1 @@ +ls-files --debug diff --git a/doc/git-lsfn/alias.txt b/doc/git-lsfn/alias.txt new file mode 100644 index 0000000..bfefbe4 --- /dev/null +++ b/doc/git-lsfn/alias.txt @@ -0,0 +1 @@ +ls-files --full-name diff --git a/doc/git-lsio/alias.txt b/doc/git-lsio/alias.txt new file mode 100644 index 0000000..100d433 --- /dev/null +++ b/doc/git-lsio/alias.txt @@ -0,0 +1 @@ +ls-files --ignored --others --exclude-standard diff --git a/doc/git-lto/alias.txt b/doc/git-lto/alias.txt new file mode 100644 index 0000000..c7add92 --- /dev/null +++ b/doc/git-lto/alias.txt @@ -0,0 +1 @@ +log --topo-order diff --git a/doc/git-m/alias.txt b/doc/git-m/alias.txt new file mode 100644 index 0000000..a00af07 --- /dev/null +++ b/doc/git-m/alias.txt @@ -0,0 +1 @@ +merge diff --git a/doc/git-ma/alias.txt b/doc/git-ma/alias.txt new file mode 100644 index 0000000..36114d4 --- /dev/null +++ b/doc/git-ma/alias.txt @@ -0,0 +1 @@ +merge --abort diff --git a/doc/git-mainly/alias.sh b/doc/git-mainly/alias.sh new file mode 100644 index 0000000..a234387 --- /dev/null +++ b/doc/git-mainly/alias.sh @@ -0,0 +1 @@ +git checkout "$(git default-branch)" && git fetch origin --prune && git reset --hard "origin/$(git default-branch)" diff --git a/doc/git-mc/alias.txt b/doc/git-mc/alias.txt new file mode 100644 index 0000000..9ad5ee7 --- /dev/null +++ b/doc/git-mc/alias.txt @@ -0,0 +1 @@ +merge --continue diff --git a/doc/git-merge-span-diff/alias.sh b/doc/git-merge-span-diff/alias.sh new file mode 100644 index 0000000..6c04a98 --- /dev/null +++ b/doc/git-merge-span-diff/alias.sh @@ -0,0 +1 @@ +git diff "$(git merge-span ... "$1")" diff --git a/doc/git-merge-span-difftool/alias.sh b/doc/git-merge-span-difftool/alias.sh new file mode 100644 index 0000000..3f3f5a9 --- /dev/null +++ b/doc/git-merge-span-difftool/alias.sh @@ -0,0 +1 @@ +git difftool "$(git merge-span ... "$1")" diff --git a/doc/git-merge-span-log/alias.sh b/doc/git-merge-span-log/alias.sh new file mode 100644 index 0000000..ea683bd --- /dev/null +++ b/doc/git-merge-span-log/alias.sh @@ -0,0 +1 @@ +git log "$(git merge-span .. "$1")" diff --git a/doc/git-merge-span/alias.sh b/doc/git-merge-span/alias.sh new file mode 100644 index 0000000..077c721 --- /dev/null +++ b/doc/git-merge-span/alias.sh @@ -0,0 +1 @@ +f() { echo "$(git log -1 "$2" --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 "$2" --merges --pretty=format:%P | cut -d' ' -f2)"; }; f diff --git a/doc/git-mncnf/alias.txt b/doc/git-mncnf/alias.txt new file mode 100644 index 0000000..d25004b --- /dev/null +++ b/doc/git-mncnf/alias.txt @@ -0,0 +1 @@ +merge --no-commit --no-ff diff --git a/doc/git-move-alias/alias.sh b/doc/git-move-alias/alias.sh new file mode 100644 index 0000000..cbbf4b0 --- /dev/null +++ b/doc/git-move-alias/alias.sh @@ -0,0 +1 @@ +f() { if [ $# != 3 ]; then echo "Usage: git move-alias ( --local | --global ) "; echo "Error: this command needs 3 arguments."; return 2; fi; if [ "$2" = "$3" ]; then echo "The alias names are identical, thus no change happened."; return 3; fi; if [ -z "$(git config "$1" --get alias."$2")" ]; then echo "Alias '$2' does not exist, thus no change happened."; return 4; fi; if [ -n "$(git config "$1" --get alias."$3")" ]; then echo "Alias '$3' already exists, thus no change happened."; return 5; fi; git config "$1" alias."$3" "$(git config "$1" --get alias."$2")" && git config "$1" --unset alias."$2" && return 0; echo "Usage: git move-alias ( --local | --global ) "; echo "Error: unknown failure."; return 1; };f diff --git a/doc/git-o/alias.txt b/doc/git-o/alias.txt new file mode 100644 index 0000000..72c48c6 --- /dev/null +++ b/doc/git-o/alias.txt @@ -0,0 +1 @@ +checkout diff --git a/doc/git-optimizer/alias.sh b/doc/git-optimizer/alias.sh new file mode 100644 index 0000000..fe87865 --- /dev/null +++ b/doc/git-optimizer/alias.sh @@ -0,0 +1 @@ +git pruner diff --git a/doc/git-orphans/alias.txt b/doc/git-orphans/alias.txt new file mode 100644 index 0000000..f918ea1 --- /dev/null +++ b/doc/git-orphans/alias.txt @@ -0,0 +1 @@ +fsck --full diff --git a/doc/git-ours/alias.sh b/doc/git-ours/alias.sh new file mode 100644 index 0000000..badd4e7 --- /dev/null +++ b/doc/git-ours/alias.sh @@ -0,0 +1 @@ +f() { git checkout --ours "$@" && git add "$@"; }; f diff --git a/doc/git-outbound/alias.txt b/doc/git-outbound/alias.txt new file mode 100644 index 0000000..b17ce34 --- /dev/null +++ b/doc/git-outbound/alias.txt @@ -0,0 +1 @@ +log @{upstream}.. diff --git a/doc/git-p/alias.txt b/doc/git-p/alias.txt new file mode 100644 index 0000000..78a4bc3 --- /dev/null +++ b/doc/git-p/alias.txt @@ -0,0 +1 @@ +pull diff --git a/doc/git-panic/alias.sh b/doc/git-panic/alias.sh new file mode 100644 index 0000000..0792279 --- /dev/null +++ b/doc/git-panic/alias.sh @@ -0,0 +1 @@ +tar cvf ../panic.tar -- * diff --git a/doc/git-pf/alias.txt b/doc/git-pf/alias.txt new file mode 100644 index 0000000..fba97a8 --- /dev/null +++ b/doc/git-pf/alias.txt @@ -0,0 +1 @@ +pull --ff-only diff --git a/doc/git-pr/alias.txt b/doc/git-pr/alias.txt new file mode 100644 index 0000000..ee8f08a --- /dev/null +++ b/doc/git-pr/alias.txt @@ -0,0 +1 @@ +pull --rebase diff --git a/doc/git-prp/alias.txt b/doc/git-prp/alias.txt new file mode 100644 index 0000000..e564d3d --- /dev/null +++ b/doc/git-prp/alias.txt @@ -0,0 +1 @@ +pull --rebase=preserve diff --git a/doc/git-pruner/alias.sh b/doc/git-pruner/alias.sh new file mode 100644 index 0000000..579d593 --- /dev/null +++ b/doc/git-pruner/alias.sh @@ -0,0 +1 @@ +git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all diff --git a/doc/git-publish/alias.sh b/doc/git-publish/alias.sh new file mode 100644 index 0000000..0879c08 --- /dev/null +++ b/doc/git-publish/alias.sh @@ -0,0 +1 @@ +git push --set-upstream origin "$(git current-branch)" diff --git a/doc/git-pull1/alias.sh b/doc/git-pull1/alias.sh new file mode 100644 index 0000000..8ff7dae --- /dev/null +++ b/doc/git-pull1/alias.sh @@ -0,0 +1 @@ +git pull origin "$(git current-branch)" diff --git a/doc/git-push1/alias.sh b/doc/git-push1/alias.sh new file mode 100644 index 0000000..3d9bcac --- /dev/null +++ b/doc/git-push1/alias.sh @@ -0,0 +1 @@ +git push origin "$(git current-branch)" diff --git a/doc/git-pushy/alias.sh b/doc/git-pushy/alias.sh new file mode 100644 index 0000000..1b85e03 --- /dev/null +++ b/doc/git-pushy/alias.sh @@ -0,0 +1 @@ +git push --force-with-lease diff --git a/doc/git-put/alias.sh b/doc/git-put/alias.sh new file mode 100644 index 0000000..2ac5796 --- /dev/null +++ b/doc/git-put/alias.sh @@ -0,0 +1 @@ +git commit --all && git push diff --git a/doc/git-rb/alias.txt b/doc/git-rb/alias.txt new file mode 100644 index 0000000..97ef86e --- /dev/null +++ b/doc/git-rb/alias.txt @@ -0,0 +1 @@ +rebase diff --git a/doc/git-rba/alias.txt b/doc/git-rba/alias.txt new file mode 100644 index 0000000..2c698e7 --- /dev/null +++ b/doc/git-rba/alias.txt @@ -0,0 +1 @@ +rebase --abort diff --git a/doc/git-rbc/alias.txt b/doc/git-rbc/alias.txt new file mode 100644 index 0000000..21c60c4 --- /dev/null +++ b/doc/git-rbc/alias.txt @@ -0,0 +1 @@ +rebase --continue diff --git a/doc/git-rbi/alias.txt b/doc/git-rbi/alias.txt new file mode 100644 index 0000000..aabe299 --- /dev/null +++ b/doc/git-rbi/alias.txt @@ -0,0 +1 @@ +rebase --interactive diff --git a/doc/git-rbiu/alias.txt b/doc/git-rbiu/alias.txt new file mode 100644 index 0000000..5bb7ee8 --- /dev/null +++ b/doc/git-rbiu/alias.txt @@ -0,0 +1 @@ +rebase --interactive @{upstream} diff --git a/doc/git-rbs/alias.txt b/doc/git-rbs/alias.txt new file mode 100644 index 0000000..47fe084 --- /dev/null +++ b/doc/git-rbs/alias.txt @@ -0,0 +1 @@ +rebase --skip diff --git a/doc/git-rebase-branch/alias.sh b/doc/git-rebase-branch/alias.sh new file mode 100644 index 0000000..3eb4712 --- /dev/null +++ b/doc/git-rebase-branch/alias.sh @@ -0,0 +1 @@ +f() { git rebase --interactive "$(git merge-base "$(git default-branch)") HEAD)"; }; f diff --git a/doc/git-rebase-recent/alias.sh b/doc/git-rebase-recent/alias.sh new file mode 100644 index 0000000..9e69fb6 --- /dev/null +++ b/doc/git-rebase-recent/alias.sh @@ -0,0 +1 @@ +git rebase --interactive "$(git remote-ref)" diff --git a/doc/git-refs-by-date/alias.txt b/doc/git-refs-by-date/alias.txt new file mode 100644 index 0000000..299ae29 --- /dev/null +++ b/doc/git-refs-by-date/alias.txt @@ -0,0 +1 @@ +for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) (objectname:short) %(contents:subject)' diff --git a/doc/git-reincarnate/alias.sh b/doc/git-reincarnate/alias.sh new file mode 100644 index 0000000..e02c6c4 --- /dev/null +++ b/doc/git-reincarnate/alias.sh @@ -0,0 +1 @@ +f() { [ $# -gt 0 ] && git checkout "$1" && git unpublish && git checkout main && git branch -D "$1" && git checkout -b "$1" && git publish; }; f diff --git a/doc/git-remote-ref/alias.sh b/doc/git-remote-ref/alias.sh new file mode 100644 index 0000000..83e3d6b --- /dev/null +++ b/doc/git-remote-ref/alias.sh @@ -0,0 +1 @@ + local_ref="$(git symbolic-ref HEAD)"; local_name="${local_ref##refs/heads/}"; remote="$(git config branch."#local_name".remote || echo origin)"; remote_ref="$(git config branch."$local_name".merge)"; remote_name="${remote_ref##refs/heads/}"; echo "remotes/$remote/$remote_name" # diff --git a/doc/git-remotes-prune/alias.sh b/doc/git-remotes-prune/alias.sh new file mode 100644 index 0000000..dd01001 --- /dev/null +++ b/doc/git-remotes-prune/alias.sh @@ -0,0 +1 @@ +git remote | xargs -n 1 git remote prune diff --git a/doc/git-remotes-push/alias.sh b/doc/git-remotes-push/alias.sh new file mode 100644 index 0000000..b364cd5 --- /dev/null +++ b/doc/git-remotes-push/alias.sh @@ -0,0 +1 @@ +git remote | xargs -I% -n1 git push % diff --git a/doc/git-repacker/alias.txt b/doc/git-repacker/alias.txt new file mode 100644 index 0000000..67f6732 --- /dev/null +++ b/doc/git-repacker/alias.txt @@ -0,0 +1 @@ +repack -a -d -f --depth=300 --window=300 --window-memory=1g diff --git a/doc/git-reset-commit-hard-clean/alias.sh b/doc/git-reset-commit-hard-clean/alias.sh new file mode 100644 index 0000000..d607f23 --- /dev/null +++ b/doc/git-reset-commit-hard-clean/alias.sh @@ -0,0 +1 @@ +git reset --hard HEAD~1 && git clean -fd diff --git a/doc/git-reset-commit-hard/alias.txt b/doc/git-reset-commit-hard/alias.txt new file mode 100644 index 0000000..f4a1930 --- /dev/null +++ b/doc/git-reset-commit-hard/alias.txt @@ -0,0 +1 @@ +reset --hard HEAD~1 diff --git a/doc/git-reset-commit/alias.txt b/doc/git-reset-commit/alias.txt new file mode 100644 index 0000000..3e7d654 --- /dev/null +++ b/doc/git-reset-commit/alias.txt @@ -0,0 +1 @@ +reset --soft HEAD~1 diff --git a/doc/git-reset-to-pristine/alias.sh b/doc/git-reset-to-pristine/alias.sh new file mode 100644 index 0000000..64e9766 --- /dev/null +++ b/doc/git-reset-to-pristine/alias.sh @@ -0,0 +1 @@ +git reset --hard && git clean -ffdx diff --git a/doc/git-reset-to-upstream/alias.sh b/doc/git-reset-to-upstream/alias.sh new file mode 100644 index 0000000..392e574 --- /dev/null +++ b/doc/git-reset-to-upstream/alias.sh @@ -0,0 +1 @@ +git reset --hard "$(git upstream-branch)" diff --git a/doc/git-rev-list-all-objects-by-size-and-name/alias.sh b/doc/git-rev-list-all-objects-by-size-and-name/alias.sh new file mode 100644 index 0000000..6407071 --- /dev/null +++ b/doc/git-rev-list-all-objects-by-size-and-name/alias.sh @@ -0,0 +1 @@ +git rev-list --all --objects | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | awk '/^blob/ {print substr($0,6)}' | sort --numeric-sort --key=2 diff --git a/doc/git-rev-list-all-objects-by-size/alias.sh b/doc/git-rev-list-all-objects-by-size/alias.sh new file mode 100644 index 0000000..1d6ef99 --- /dev/null +++ b/doc/git-rev-list-all-objects-by-size/alias.sh @@ -0,0 +1 @@ +git rev-list --all --objects | awk '{print $1}'| git cat-file --batch-check | grep -F blob | sort -k3nr diff --git a/doc/git-rl/alias.txt b/doc/git-rl/alias.txt new file mode 100644 index 0000000..ce4db97 --- /dev/null +++ b/doc/git-rl/alias.txt @@ -0,0 +1 @@ +reflog diff --git a/doc/git-rr/alias.txt b/doc/git-rr/alias.txt new file mode 100644 index 0000000..9c998f7 --- /dev/null +++ b/doc/git-rr/alias.txt @@ -0,0 +1 @@ +remote diff --git a/doc/git-rrp/alias.txt b/doc/git-rrp/alias.txt new file mode 100644 index 0000000..a98cded --- /dev/null +++ b/doc/git-rrp/alias.txt @@ -0,0 +1 @@ +remote prune diff --git a/doc/git-rrs/alias.txt b/doc/git-rrs/alias.txt new file mode 100644 index 0000000..b840c89 --- /dev/null +++ b/doc/git-rrs/alias.txt @@ -0,0 +1 @@ +remote show diff --git a/doc/git-rru/alias.txt b/doc/git-rru/alias.txt new file mode 100644 index 0000000..d786f99 --- /dev/null +++ b/doc/git-rru/alias.txt @@ -0,0 +1 @@ +remote update diff --git a/doc/git-rv/alias.txt b/doc/git-rv/alias.txt new file mode 100644 index 0000000..5de733e --- /dev/null +++ b/doc/git-rv/alias.txt @@ -0,0 +1 @@ +revert diff --git a/doc/git-rvnc/alias.txt b/doc/git-rvnc/alias.txt new file mode 100644 index 0000000..5dd968f --- /dev/null +++ b/doc/git-rvnc/alias.txt @@ -0,0 +1 @@ +revert --no-commit diff --git a/doc/git-s/alias.txt b/doc/git-s/alias.txt new file mode 100644 index 0000000..8be5547 --- /dev/null +++ b/doc/git-s/alias.txt @@ -0,0 +1 @@ +status diff --git a/doc/git-sb/alias.txt b/doc/git-sb/alias.txt new file mode 100644 index 0000000..eb554e0 --- /dev/null +++ b/doc/git-sb/alias.txt @@ -0,0 +1 @@ +show-branch diff --git a/doc/git-search-commits/alias.sh b/doc/git-search-commits/alias.sh new file mode 100644 index 0000000..4f46fcf --- /dev/null +++ b/doc/git-search-commits/alias.sh @@ -0,0 +1 @@ +f() { query="$1"; shift; git log -S"$query" "$@"; }; f "$@" diff --git a/doc/git-serve/alias.txt b/doc/git-serve/alias.txt new file mode 100644 index 0000000..0cddd2c --- /dev/null +++ b/doc/git-serve/alias.txt @@ -0,0 +1 @@ +-c daemon.receivepack=true daemon --base-path=. --export-all --reuseaddr --verbose diff --git a/doc/git-show-unreachable/alias.sh b/doc/git-show-unreachable/alias.sh new file mode 100644 index 0000000..4d46b0a --- /dev/null +++ b/doc/git-show-unreachable/alias.sh @@ -0,0 +1 @@ +git fsck --unreachable | grep commit | cut -d" " -f3 | xargs git log diff --git a/doc/git-sm/alias.txt b/doc/git-sm/alias.txt new file mode 100644 index 0000000..e2d6b89 --- /dev/null +++ b/doc/git-sm/alias.txt @@ -0,0 +1 @@ +submodule diff --git a/doc/git-sma/alias.txt b/doc/git-sma/alias.txt new file mode 100644 index 0000000..8906d57 --- /dev/null +++ b/doc/git-sma/alias.txt @@ -0,0 +1 @@ +submodule add diff --git a/doc/git-smi/alias.txt b/doc/git-smi/alias.txt new file mode 100644 index 0000000..6234efa --- /dev/null +++ b/doc/git-smi/alias.txt @@ -0,0 +1 @@ +submodule init diff --git a/doc/git-sms/alias.txt b/doc/git-sms/alias.txt new file mode 100644 index 0000000..f2a0a6e --- /dev/null +++ b/doc/git-sms/alias.txt @@ -0,0 +1 @@ +submodule sync diff --git a/doc/git-smu/alias.txt b/doc/git-smu/alias.txt new file mode 100644 index 0000000..dfbaa3e --- /dev/null +++ b/doc/git-smu/alias.txt @@ -0,0 +1 @@ +submodule update diff --git a/doc/git-smui/alias.txt b/doc/git-smui/alias.txt new file mode 100644 index 0000000..29c77fe --- /dev/null +++ b/doc/git-smui/alias.txt @@ -0,0 +1 @@ +submodule update --init diff --git a/doc/git-smuir/alias.txt b/doc/git-smuir/alias.txt new file mode 100644 index 0000000..955f003 --- /dev/null +++ b/doc/git-smuir/alias.txt @@ -0,0 +1 @@ +submodule update --init --recursive diff --git a/doc/git-snapshot/alias.sh b/doc/git-snapshot/alias.sh new file mode 100644 index 0000000..4c4d68b --- /dev/null +++ b/doc/git-snapshot/alias.sh @@ -0,0 +1 @@ +git stash push --include-untracked --message "snapshot: $(date)" && git stash apply "stash@{0}" --index diff --git a/doc/git-ss/alias.txt b/doc/git-ss/alias.txt new file mode 100644 index 0000000..d8fdada --- /dev/null +++ b/doc/git-ss/alias.txt @@ -0,0 +1 @@ +status --short diff --git a/doc/git-ssb/alias.txt b/doc/git-ssb/alias.txt new file mode 100644 index 0000000..808e9e7 --- /dev/null +++ b/doc/git-ssb/alias.txt @@ -0,0 +1 @@ +status --short --branch diff --git a/doc/git-stashes/alias.txt b/doc/git-stashes/alias.txt new file mode 100644 index 0000000..97a9358 --- /dev/null +++ b/doc/git-stashes/alias.txt @@ -0,0 +1 @@ +stash list diff --git a/doc/git-summary/alias.sh b/doc/git-summary/alias.sh new file mode 100644 index 0000000..8799280 --- /dev/null +++ b/doc/git-summary/alias.sh @@ -0,0 +1,26 @@ +f() { printf "Summary of this branch... +"; printf "%s +" "$(git rev-parse --abbrev-ref HEAD)"; printf "%s first commit timestamp +" "$(git log --date-order --format=%cI | tail -1)"; printf "%s last commit timestamp +" "$(git log -1 --date-order --format=%cI)"; printf " +Summary of counts... +"; printf "%d commit count +" "$(git rev-list --count HEAD)"; printf "%d date count +" "$(git log --format=oneline --format="%ad" --date=format:"%Y-%m-%d" | awk '{a[$0]=1}END{for(i in a){n++;} print n}')"; printf "%d tag count +" "$(git tag | wc -l)"; printf "%d author count +" "$(git log --format=oneline --format="%aE" | awk '{a[$0]=1}END{for(i in a){n++;} print n}')"; printf "%d committer count +" "$(git log --format=oneline --format="%cE" | awk '{a[$0]=1}END{for(i in a){n++;} print n}')"; printf "%d local branch count +" "$(git branch | grep -vc " -> ")"; printf "%d remote branch count +" "$(git branch -r | grep -vc " -> ")"; printf " +Summary of this directory... +"; printf "%s +" "$(pwd)"; printf "%d file count via git ls-files +" "$(git ls-files | wc -l)"; printf "%d file count via find command +" "$(find . | wc -l)"; printf "%d disk usage +" "$(du -s | awk '{print $1}')"; printf " +Most-active authors, with commit count and %%... +"; git log-of-count-and-email | head -7; printf " +Most-active dates, with commit count and %%... +"; git log-of-count-and-day | head -7; printf " +Most-active files, with churn count +"; git churn | head -7; }; f diff --git a/doc/git-svn-b/alias.txt b/doc/git-svn-b/alias.txt new file mode 100644 index 0000000..8e1ef64 --- /dev/null +++ b/doc/git-svn-b/alias.txt @@ -0,0 +1 @@ +svn branch diff --git a/doc/git-svn-c/alias.txt b/doc/git-svn-c/alias.txt new file mode 100644 index 0000000..d0d54f6 --- /dev/null +++ b/doc/git-svn-c/alias.txt @@ -0,0 +1 @@ +svn dcommit diff --git a/doc/git-svn-cp/alias.sh b/doc/git-svn-cp/alias.sh new file mode 100644 index 0000000..90eb924 --- /dev/null +++ b/doc/git-svn-cp/alias.sh @@ -0,0 +1 @@ +GIT_EDITOR='sed -i /^git-svn-id:/d' git cherry-pick --edit diff --git a/doc/git-svn-m/alias.txt b/doc/git-svn-m/alias.txt new file mode 100644 index 0000000..00f434e --- /dev/null +++ b/doc/git-svn-m/alias.txt @@ -0,0 +1 @@ +merge --squash diff --git a/doc/git-tags/alias.txt b/doc/git-tags/alias.txt new file mode 100644 index 0000000..f89dc0b --- /dev/null +++ b/doc/git-tags/alias.txt @@ -0,0 +1 @@ +tag -n1 --list diff --git a/doc/git-theirs/alias.sh b/doc/git-theirs/alias.sh new file mode 100644 index 0000000..8ee4598 --- /dev/null +++ b/doc/git-theirs/alias.sh @@ -0,0 +1 @@ +f() { git checkout --theirs "$@" && git add "$@"; }; f diff --git a/doc/git-top/alias.txt b/doc/git-top/alias.txt new file mode 100644 index 0000000..42c595b --- /dev/null +++ b/doc/git-top/alias.txt @@ -0,0 +1 @@ +rev-parse --show-toplevel diff --git a/doc/git-topic-base-branch/alias.sh b/doc/git-topic-base-branch/alias.sh new file mode 100644 index 0000000..0c418e1 --- /dev/null +++ b/doc/git-topic-base-branch/alias.sh @@ -0,0 +1 @@ +git config --get init.topicBaseBranchName || git default-branch diff --git a/doc/git-topic-begin/alias.sh b/doc/git-topic-begin/alias.sh new file mode 100644 index 0000000..4053f0c --- /dev/null +++ b/doc/git-topic-begin/alias.sh @@ -0,0 +1 @@ +f(){ new_branch="$1"; old_branch="$(git topic-base-branch)"; git checkout "$old_branch"; git pull --ff-only; git checkout -b "$new_branch" "$old_branch"; git push -u origin "$new_branch"; };f diff --git a/doc/git-topic-end/alias.sh b/doc/git-topic-end/alias.sh new file mode 100644 index 0000000..378496e --- /dev/null +++ b/doc/git-topic-end/alias.sh @@ -0,0 +1,6 @@ +f(){ new_branch="$(git current-branch)"; old_branch="$(git topic-base-branch)"; if [ "$new_branch" = "$old_branch" ]; then printf "You are asking to do git topic-end, +"; printf "but you are not on a new topic branch; +"; printf "you are on the base topic branch: %s. +" "$old_branch"; printf "Please checkout the topic branch that you want, +"; printf "then retry the git topic-end command. +"; else git push; git checkout "$old_branch"; git branch --delete "$new_branch"; git push origin ":$new_branch"; fi; };f diff --git a/doc/git-topic-move/alias.sh b/doc/git-topic-move/alias.sh new file mode 100644 index 0000000..ac919ff --- /dev/null +++ b/doc/git-topic-move/alias.sh @@ -0,0 +1 @@ +f(){ new_branch="$1"; old_branch="$(git current-branch)"; git branch --move "$old_branch" "$new_branch"; git push origin ":$old_branch" "$new_branch"; };f diff --git a/doc/git-topic-sync/alias.sh b/doc/git-topic-sync/alias.sh new file mode 100644 index 0000000..0fb1c2e --- /dev/null +++ b/doc/git-topic-sync/alias.sh @@ -0,0 +1,6 @@ +f(){ new_branch="$(git current-branch)"; old_branch="$(git topic-base-branch)"; if [ "$new_branch" = "$old_branch" ]; then printf "You are asking to do git topic-sync, +"; printf "but you are not on a new topic branch; +"; printf "you are on the base topic branch: %s. +" "$old_branch"; printf "Please checkout the topic branch that you want, +"; printf "then retry the git topic-sync command. +"; else git pull; git push; fi; };f diff --git a/doc/git-track-all-remote-branches/alias.sh b/doc/git-track-all-remote-branches/alias.sh new file mode 100644 index 0000000..0df7408 --- /dev/null +++ b/doc/git-track-all-remote-branches/alias.sh @@ -0,0 +1 @@ +f() { git branch -r | grep -v ' -> ' | sed 's/^ \+origin\///' ; }; f diff --git a/doc/git-track/alias.sh b/doc/git-track/alias.sh new file mode 100644 index 0000000..b76dc35 --- /dev/null +++ b/doc/git-track/alias.sh @@ -0,0 +1 @@ +f(){ branch="$(git rev-parse --abbrev-ref HEAD)"; cmd="git branch $branch -u ${1:-origin}/${2:-$branch}"; echo "$cmd"; $cmd; }; f diff --git a/doc/git-unadd/alias.txt b/doc/git-unadd/alias.txt new file mode 100644 index 0000000..225f7bc --- /dev/null +++ b/doc/git-unadd/alias.txt @@ -0,0 +1 @@ +reset HEAD diff --git a/doc/git-unassume-all/alias.sh b/doc/git-unassume-all/alias.sh new file mode 100644 index 0000000..eb338c5 --- /dev/null +++ b/doc/git-unassume-all/alias.sh @@ -0,0 +1 @@ +git assumed | xargs -r git update-index --no-assume-unchanged diff --git a/doc/git-unassume-all/index.md b/doc/git-unassume-all/index.md index fe7a053..7917621 100644 --- a/doc/git-unassume-all/index.md +++ b/doc/git-unassume-all/index.md @@ -1,4 +1,4 @@ -# git unassume +# git unassume-all ## Unassume all files diff --git a/doc/git-unassume/alias.txt b/doc/git-unassume/alias.txt new file mode 100644 index 0000000..890ea3e --- /dev/null +++ b/doc/git-unassume/alias.txt @@ -0,0 +1 @@ +update-index --no-assume-unchanged diff --git a/doc/git-uncommit/alias.txt b/doc/git-uncommit/alias.txt new file mode 100644 index 0000000..3e7d654 --- /dev/null +++ b/doc/git-uncommit/alias.txt @@ -0,0 +1 @@ +reset --soft HEAD~1 diff --git a/doc/git-undo-commit-hard-clean/alias.sh b/doc/git-undo-commit-hard-clean/alias.sh new file mode 100644 index 0000000..d607f23 --- /dev/null +++ b/doc/git-undo-commit-hard-clean/alias.sh @@ -0,0 +1 @@ +git reset --hard HEAD~1 && git clean -fd diff --git a/doc/git-undo-commit-hard/alias.txt b/doc/git-undo-commit-hard/alias.txt new file mode 100644 index 0000000..f4a1930 --- /dev/null +++ b/doc/git-undo-commit-hard/alias.txt @@ -0,0 +1 @@ +reset --hard HEAD~1 diff --git a/doc/git-undo-commit/alias.txt b/doc/git-undo-commit/alias.txt new file mode 100644 index 0000000..3e7d654 --- /dev/null +++ b/doc/git-undo-commit/alias.txt @@ -0,0 +1 @@ +reset --soft HEAD~1 diff --git a/doc/git-undo-to-pristine/alias.sh b/doc/git-undo-to-pristine/alias.sh new file mode 100644 index 0000000..64e9766 --- /dev/null +++ b/doc/git-undo-to-pristine/alias.sh @@ -0,0 +1 @@ +git reset --hard && git clean -ffdx diff --git a/doc/git-undo-to-upstream/alias.sh b/doc/git-undo-to-upstream/alias.sh new file mode 100644 index 0000000..392e574 --- /dev/null +++ b/doc/git-undo-to-upstream/alias.sh @@ -0,0 +1 @@ +git reset --hard "$(git upstream-branch)" diff --git a/doc/git-unpublish/alias.sh b/doc/git-unpublish/alias.sh new file mode 100644 index 0000000..66d6e82 --- /dev/null +++ b/doc/git-unpublish/alias.sh @@ -0,0 +1 @@ +git push origin :"$(git current-branch)" diff --git a/doc/git-untrack/alias.sh b/doc/git-untrack/alias.sh new file mode 100644 index 0000000..97f0d72 --- /dev/null +++ b/doc/git-untrack/alias.sh @@ -0,0 +1 @@ +f(){ branch="$(git rev-parse --abbrev-ref HEAD)"; cmd="git branch --unset-upstream ${1:-$branch}"; echo "$cmd"; $cmd; }; f diff --git a/doc/git-unwip/alias.sh b/doc/git-unwip/alias.sh new file mode 100644 index 0000000..c04fd43 --- /dev/null +++ b/doc/git-unwip/alias.sh @@ -0,0 +1 @@ +git log -n 1 | grep -q -c wip && git reset HEAD~1 diff --git a/doc/git-upstream-branch/alias.sh b/doc/git-upstream-branch/alias.sh new file mode 100644 index 0000000..61511c4 --- /dev/null +++ b/doc/git-upstream-branch/alias.sh @@ -0,0 +1 @@ +git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)" diff --git a/doc/git-w/alias.txt b/doc/git-w/alias.txt new file mode 100644 index 0000000..315aefd --- /dev/null +++ b/doc/git-w/alias.txt @@ -0,0 +1 @@ +whatchanged diff --git a/doc/git-whatis/alias.txt b/doc/git-whatis/alias.txt new file mode 100644 index 0000000..1791e08 --- /dev/null +++ b/doc/git-whatis/alias.txt @@ -0,0 +1 @@ +show --no-patch --pretty='tformat:%h (%s, %ad)' --date=short diff --git a/doc/git-who/alias.txt b/doc/git-who/alias.txt new file mode 100644 index 0000000..027ac1c --- /dev/null +++ b/doc/git-who/alias.txt @@ -0,0 +1 @@ +shortlog --summary --numbered --no-merges diff --git a/doc/git-whois/alias.sh b/doc/git-whois/alias.sh new file mode 100644 index 0000000..9ac9986 --- /dev/null +++ b/doc/git-whois/alias.sh @@ -0,0 +1,2 @@ +sh -c 'git log --regexp-ignore-case -1 --pretty="format:%an <%ae> +" --author="$1"' - diff --git a/doc/git-wip/alias.sh b/doc/git-wip/alias.sh new file mode 100644 index 0000000..0872b7f --- /dev/null +++ b/doc/git-wip/alias.sh @@ -0,0 +1 @@ +git add --all; git ls-files --deleted -z | xargs -r -0 git rm; git commit --message=wip diff --git a/dry.sh b/dry.sh new file mode 100755 index 0000000..ae83d67 --- /dev/null +++ b/dry.sh @@ -0,0 +1,24 @@ +#! /usr/bin/env bash +set -eu + +git config --file=gitalias.txt --null --get-regexp '^alias\.' | +while read -r -d $'\n' key +do + key="${key:6}" + read -r -d $'\0' value + + mkdir -p "doc/git-${key}" + + if [[ $value == !* ]] + then + echo "${value:1}" > "doc/git-${key}/alias.sh" + else + echo "$value" > "doc/git-${key}/alias.txt" + fi + + if [[ "$(head -n 1 "doc/git-${key}/index.md")" != "# git ${key}" ]] + then + echo "${key} : FAIL doc/git-${key}/index.md" + echo "\"$(head -n 1 "doc/git-${key}/index.md")\" != \"# git ${key}\"" + fi +done