From 00feb026c4748c12f4b0de307afba082f20df550 Mon Sep 17 00:00:00 2001 From: Joel Parker Henderson Date: Fri, 31 Dec 2021 20:51:59 +0100 Subject: [PATCH] Upgrade documentation for website --- CONTRIBUTING.md | 26 +- README.md | 860 +++++++++++------- doc/alias/TODO/index.md | 48 - doc/alias/git-aa/index.md | 14 - doc/alias/git-au/index.md | 13 - doc/alias/git-b/index.md | 13 - doc/alias/git-c/index.md | 13 - doc/alias/git-ca/index.md | 13 - doc/alias/git-cam/index.md | 13 - doc/alias/git-cleaner/index.md | 50 - doc/alias/git-d/index.md | 13 - doc/alias/git-f/index.md | 13 - doc/alias/git-initer/index.md | 18 - doc/alias/git-l/index.md | 13 - doc/alias/git-last-tag/index.md | 37 - doc/alias/git-m/index.md | 13 - doc/alias/git-o/index.md | 13 - doc/alias/git-p/index.md | 13 - doc/alias/git-publish-git-unpublish/index.md | 21 - doc/alias/git-pull1/index.md | 15 - doc/alias/git-push1/index.md | 15 - doc/alias/git-r/index.md | 13 - doc/alias/git-rb/index.md | 13 - doc/alias/git-rr/index.md | 13 - doc/alias/git-s/index.md | 13 - doc/alias/git-sb/index.md | 13 - doc/alias/index.md | 350 ------- doc/assets/prism.css | 3 + doc/assets/prism.js | 5 + doc/contribute/{contribute.md => index.md} | 4 +- doc/customize/customize.md | 46 - doc/customize/index.md | 51 ++ doc/examples/{examples.md => index.md} | 72 +- doc/{alias => }/git-a/index.md | 8 +- doc/git-aa/index.md | 16 + doc/{alias => }/git-add-alias/index.md | 6 +- doc/git-add-cached/index.md | 37 + doc/git-add-deleted/index.md | 37 + doc/git-add-ignored/index.md | 37 + doc/git-add-killed/index.md | 37 + doc/git-add-modified/index.md | 37 + doc/git-add-others/index.md | 37 + doc/git-add-stage/index.md | 37 + doc/git-add-unmerged/index.md | 37 + doc/{alias => }/git-add/index.md | 21 +- doc/{alias => }/git-aliases/index.md | 6 +- doc/{alias => }/git-ap/index.md | 8 +- doc/{alias => }/git-archive/index.md | 6 +- doc/git-assume-all/index.md | 17 + .../index.md | 8 +- doc/git-assume/index.md | 17 + doc/git-assumed/index.md | 17 + doc/git-au/index.html | 55 ++ doc/git-au/index.md | 35 + doc/git-b/index.md | 15 + doc/{alias => }/git-bed/index.md | 6 +- doc/{alias => }/git-bm/index.md | 6 +- doc/{alias => }/git-bnm/index.md | 8 +- doc/git-branch-commit-first/index.md | 52 ++ doc/git-branch-commit-last/index.md | 51 ++ doc/git-branch-commit-next/index.md | 55 ++ doc/git-branch-commit-prev/index.md | 52 ++ doc/git-branch-commit/index.md | 15 + doc/{alias => }/git-branch-name/index.md | 10 +- doc/git-branch/index.md | 38 + doc/{alias => }/git-branches/index.md | 4 +- doc/{alias => }/git-bsd/index.md | 6 +- doc/git-bv/index.md | 27 + doc/git-bvv/index.md | 27 + doc/git-c/index.md | 15 + doc/git-ca/index.md | 15 + doc/git-cam/index.md | 15 + doc/{alias => }/git-cane/index.md | 6 +- doc/{alias => }/git-chart/index.md | 6 +- .../git-cherry-pick-merge/index.md | 6 +- doc/git-churn/index.html | 97 ++ doc/{alias => }/git-churn/index.md | 16 +- doc/{alias => }/git-ci/index.md | 6 +- doc/git-cleaner/index.html | 57 ++ doc/git-cleaner/index.md | 31 + doc/{alias => }/git-cleanout/index.md | 6 +- doc/{alias => }/git-clone-lean/index.md | 6 +- doc/{alias => }/git-cloner/index.md | 6 +- doc/{alias => }/git-cm/index.md | 6 +- doc/{alias => }/git-co/index.md | 6 +- doc/{alias => }/git-cog/index.md | 6 +- doc/{alias => }/git-commit-is-merge/index.md | 6 +- .../git-commit-message-key-lines/index.md | 14 +- doc/{alias => }/git-commit-parents/index.md | 6 +- doc/{alias => }/git-cong/index.md | 6 +- doc/git-count/index.md | 0 doc/{alias => }/git-cp/index.md | 6 +- doc/{alias => }/git-cpa/index.md | 6 +- doc/{alias => }/git-cpc/index.md | 6 +- doc/{alias => }/git-cpn/index.md | 6 +- doc/{alias => }/git-cpnx/index.md | 6 +- doc/git-cull-branches/index.md | 20 + .../index.md | 24 +- .../index.md | 26 +- doc/git-cvs-e/index.md | 15 + doc/git-cvs-i/index.md | 15 + doc/{alias => }/git-cvs/index.md | 6 +- doc/git-d/index.md | 15 + doc/{alias => }/git-dc/index.md | 6 +- doc/{alias => }/git-dd/index.md | 6 +- doc/{alias => }/git-debug/index.md | 6 +- doc/{alias => }/git-default-branch/index.md | 6 +- doc/git-diff-all/index.md | 15 + doc/git-diff-changes/index.md | 15 + doc/{alias => }/git-diff-chunk/index.md | 8 +- doc/git-diff-deep/index.md | 15 + doc/git-diff-staged/index.md | 15 + doc/git-diff-stat/index.md | 15 + doc/{alias => }/git-diff/index.md | 6 +- doc/git-discard/index.md | 13 + doc/{alias => }/git-ds/index.md | 6 +- doc/git-dw/index.md | 15 + doc/{alias => }/git-dwd/index.md | 6 +- doc/git-edit-cached/index.md | 37 + doc/git-edit-deleted/index.md | 37 + doc/git-edit-ignored/index.md | 37 + doc/git-edit-killed/index.md | 37 + doc/git-edit-modified/index.md | 37 + doc/git-edit-others/index.md | 37 + doc/git-edit-stage/index.md | 37 + doc/git-edit-unmerged/index.md | 37 + doc/{alias => }/git-edit/index.md | 6 +- doc/git-exec/index.html | 29 + doc/{alias => }/git-exec/index.md | 6 +- doc/git-expunge/index.html | 38 + doc/{alias => }/git-expunge/index.md | 6 +- doc/git-f/index.md | 15 + doc/git-fa/index.md | 15 + doc/git-fav/index.md | 15 + doc/{alias => }/git-fixup/index.md | 6 +- doc/{alias => }/git-g/index.md | 8 +- doc/{alias => }/git-get-git-put/index.md | 16 +- doc/git-get/index.md | 23 + doc/{alias => }/git-gg/index.md | 6 +- doc/{alias => }/git-gitk-conflict/index.md | 6 +- doc/{alias => }/git-gitk-history-all/index.md | 8 +- doc/git-gitk/index.md | 6 + doc/{alias => }/git-gn/index.md | 6 +- doc/{alias => }/git-graphviz/index.md | 8 +- doc/git-grep-ack/index.md | 0 doc/git-grep-all/index.md | 21 + doc/git-grep-group/index.md | 21 + doc/{alias => }/git-grep/index.md | 6 +- doc/git-heads/index.md | 17 + doc/git-ignore/index.md | 15 + doc/{alias => }/git-inbound/index.md | 6 +- doc/git-init-empty/index.md | 21 + doc/{alias => }/git-intercommit/index.md | 6 +- doc/{alias => }/git-issues/index.md | 10 +- doc/git-l/index.md | 15 + doc/git-last-tag/index.md | 25 + doc/git-last-tagged/index.md | 15 + doc/{alias => }/git-lfp/index.md | 6 +- doc/{alias => }/git-lg/index.md | 6 +- doc/{alias => }/git-ll/index.md | 8 +- doc/{alias => }/git-lll/index.md | 8 +- doc/{alias => }/git-lo/index.md | 6 +- doc/git-log-1-day/index.md | 39 + doc/git-log-1-hour/index.md | 39 + doc/git-log-1-month/index.md | 39 + doc/git-log-1-week/index.md | 39 + doc/git-log-1-year/index.md | 39 + doc/git-log-date-first/index.md | 18 + doc/git-log-date-last/index.md | 17 + doc/git-log-fetched/index.md | 17 + doc/git-log-fresh/index.md | 15 + doc/git-log-graph/index.md | 3 + doc/git-log-like-long/index.md | 3 + doc/git-log-like/index.md | 3 + doc/git-log-my-day/index.md | 39 + doc/git-log-my-hour/index.md | 39 + doc/git-log-my-month/index.md | 39 + doc/git-log-my-week/index.md | 39 + doc/git-log-my-year/index.md | 39 + doc/git-log-my/index.md | 15 + doc/git-log-of-count-and-day-of-week/index.md | 17 + doc/git-log-of-count-and-day/index.md | 17 + doc/git-log-of-count-and-email/index.md | 17 + .../index.md | 17 + doc/git-log-of-count-and-format/index.md | 17 + doc/git-log-of-count-and-hour-of-day/index.md | 17 + doc/git-log-of-count-and-hour/index.md | 17 + doc/git-log-of-count-and-month/index.md | 17 + .../index.md | 17 + doc/git-log-of-count-and-week/index.md | 17 + doc/git-log-of-count-and-year/index.md | 17 + doc/git-log-of-day-and-count/index.md | 17 + doc/git-log-of-day-of-week-and-count/index.md | 17 + doc/git-log-of-email-and-count/index.md | 17 + .../index.md | 17 + doc/git-log-of-format-and-count/index.md | 17 + doc/git-log-of-hour-and-count/index.md | 17 + doc/git-log-of-hour-of-day-and-count/index.md | 17 + doc/git-log-of-month-and-count/index.md | 17 + doc/git-log-of-week-and-count/index.md | 17 + .../index.md | 17 + doc/git-log-of-year-and-count/index.md | 17 + doc/{alias/git-log => git-log-of}/index.md | 257 ++++-- doc/git-log-refs/index.md | 15 + doc/git-log-timeline/index.md | 3 + doc/git-log/index.md | 82 ++ doc/git-lor/index.md | 15 + doc/{alias => }/git-lp/index.md | 6 +- doc/{alias => }/git-ls/index.md | 6 +- doc/{alias => }/git-lsd/index.md | 6 +- doc/{alias => }/git-lsfn/index.md | 6 +- doc/{alias => }/git-lsio/index.md | 6 +- doc/{alias => }/git-lto/index.md | 6 +- doc/git-m/index.md | 15 + doc/{alias => }/git-ma/index.md | 6 +- doc/git-mainly/index.md | 20 + doc/{alias => }/git-mc/index.md | 6 +- doc/{alias => }/git-merge-safe/index.md | 6 +- doc/git-merge-span-diff/index.md | 20 + doc/git-merge-span-difftool/index.md | 20 + doc/git-merge-span-log/index.md | 22 + doc/{alias => }/git-merge-span/index.md | 15 +- doc/git-mncnf/index.md | 17 + doc/{alias => }/git-move-alias/index.md | 6 +- doc/git-my-branch/index.md | 22 + doc/git-o/index.md | 15 + doc/{alias => }/git-optimizer/index.md | 8 +- doc/{alias => }/git-orphans/index.md | 8 +- doc/{alias => }/git-ours-git-theirs/index.md | 12 +- doc/git-ours/index.md | 23 + doc/{alias => }/git-outbound/index.md | 8 +- doc/git-p/index.md | 15 + doc/{alias => }/git-panic/index.md | 6 +- doc/{alias => }/git-pf/index.md | 8 +- doc/{alias => }/git-pp/index.md | 6 +- doc/{alias => }/git-pr/index.md | 14 +- doc/{alias => }/git-pruner/index.md | 6 +- doc/git-publish-git-unpublish/index.html | 181 ++++ doc/git-publish-git-unpublish/index.md | 9 + doc/git-publish/index.md | 26 + doc/git-pull1/index.md | 17 + doc/git-push1/index.md | 17 + doc/git-pushy/index.md | 22 + doc/git-put/index.md | 23 + doc/git-rb/index.md | 15 + doc/{alias => }/git-rba/index.md | 6 +- doc/{alias => }/git-rbc/index.md | 6 +- doc/{alias => }/git-rbi/index.md | 6 +- doc/{alias => }/git-rbiu/index.md | 14 +- doc/{alias => }/git-rbs/index.md | 6 +- doc/git-rebase-branch/index.md | 15 + .../git-rebase-interactive-branch/index.md | 6 +- doc/git-rebase-recent/index.md | 17 + doc/git-ref-recent/index.md | 0 doc/{alias => }/git-refs-by-date/index.md | 6 +- doc/{alias => }/git-reincarnate/index.md | 6 +- doc/git-remote-ref/index.md | 23 + doc/{alias => }/git-remotes-prune/index.md | 8 +- doc/{alias => }/git-remotes-push/index.md | 8 +- doc/{alias => }/git-repacker/index.md | 10 +- doc/git-reset-commit-hard-clean/index.md | 20 + doc/git-reset-commit-hard/index.md | 19 + doc/git-reset-commit/index.md | 20 + doc/git-reset-to-pristine/index.md | 19 + doc/git-reset-to-upstream/index.md | 20 + doc/{alias => }/git-reset/index.md | 10 +- .../index.md | 6 +- .../git-rev-list-all-objects-by-size/index.md | 6 +- doc/{alias => }/git-rl/index.md | 8 +- doc/git-rr/index.md | 15 + doc/{alias => }/git-rrp/index.md | 6 +- doc/{alias => }/git-rrs/index.md | 6 +- doc/{alias => }/git-rru/index.md | 6 +- doc/{alias => }/git-rv/index.md | 8 +- doc/{alias => }/git-rvnc/index.md | 8 +- doc/git-s/index.md | 15 + doc/git-sb/index.md | 15 + doc/{alias => }/git-sbdo/index.md | 6 +- doc/{alias => }/git-sbto/index.md | 6 +- doc/{alias => }/git-search-commits/index.md | 18 +- doc/{alias => }/git-serve/index.md | 6 +- doc/git-show-unreachable/index.md | 17 + doc/{alias => }/git-sm/index.md | 8 +- doc/{alias => }/git-sma/index.md | 6 +- doc/{alias => }/git-smi/index.md | 6 +- doc/{alias => }/git-sms/index.md | 6 +- doc/{alias => }/git-smu/index.md | 6 +- doc/{alias => }/git-smui/index.md | 6 +- doc/{alias => }/git-smuir/index.md | 6 +- doc/{alias => }/git-snapshot/index.md | 10 +- doc/{alias => }/git-ss/index.md | 6 +- doc/{alias => }/git-ssb/index.md | 6 +- doc/{alias => }/git-stashes/index.md | 6 +- doc/git-submodule/index.md | 14 + doc/{alias => }/git-summary/index.md | 6 +- doc/git-svn-b/index.md | 15 + doc/git-svn-c/index.md | 15 + doc/git-svn-cp/index.md | 15 + doc/git-svn-m/index.md | 15 + doc/{alias => }/git-svn/index.md | 6 +- doc/{alias => }/git-tags/index.md | 6 +- doc/git-theirs/index.md | 23 + doc/{alias/git-top-name => git-top}/index.md | 12 +- .../index.md | 14 +- .../index.md | 18 +- .../git-topic-stop => git-topic-end}/index.md | 22 +- doc/{alias => }/git-topic-move/index.md | 8 +- doc/{alias => }/git-topic-sync/index.md | 12 +- doc/{alias => }/git-topic/index.md | 36 +- .../git-track-all-remote-branches/index.md | 6 +- doc/{alias => }/git-track/index.md | 6 +- doc/{alias => }/git-unadd/index.md | 6 +- doc/git-unassume-all/index.md | 17 + doc/git-unassume/index.md | 17 + doc/{alias => }/git-uncommit/index.md | 6 +- doc/git-undo-commit-hard-clean/index.md | 20 + doc/git-undo-commit-hard/index.md | 20 + doc/git-undo-commit/index.md | 20 + doc/git-undo-to-pristine/index.md | 20 + doc/git-undo-to-upstream/index.md | 19 + doc/{alias => }/git-undo/index.md | 12 +- doc/git-unpublish/index.md | 26 + doc/{alias => }/git-untrack/index.md | 8 +- doc/git-unwip/index.md | 23 + doc/{alias => }/git-upstream-branch/index.md | 12 +- doc/{alias => }/git-w/index.md | 4 +- doc/{alias => }/git-whatis/index.md | 6 +- doc/{alias => }/git-who/index.md | 6 +- doc/{alias => }/git-whois/index.md | 8 +- doc/{alias => }/git-wip-git-unwip/index.md | 26 +- doc/git-wip/index.md | 23 + doc/index.html | 689 ++++++++++++++ doc/index.md | 672 ++++++++++++++ doc/index/index.md | 4 - doc/install/{install.md => index.md} | 8 +- .../{introduction.md => index.md} | 4 +- doc/more/{more.md => index.md} | 10 +- doc/site/templates/template.html | 38 + doc/thanks/{thanks.md => index.md} | 4 +- doc/todo/{todo.md => index.md} | 2 - gitalias.txt | 253 +++--- 341 files changed, 6874 insertions(+), 1808 deletions(-) delete mode 100644 doc/alias/TODO/index.md delete mode 100644 doc/alias/git-aa/index.md delete mode 100644 doc/alias/git-au/index.md delete mode 100644 doc/alias/git-b/index.md delete mode 100644 doc/alias/git-c/index.md delete mode 100644 doc/alias/git-ca/index.md delete mode 100644 doc/alias/git-cam/index.md delete mode 100644 doc/alias/git-cleaner/index.md delete mode 100644 doc/alias/git-d/index.md delete mode 100644 doc/alias/git-f/index.md delete mode 100644 doc/alias/git-initer/index.md delete mode 100644 doc/alias/git-l/index.md delete mode 100644 doc/alias/git-last-tag/index.md delete mode 100644 doc/alias/git-m/index.md delete mode 100644 doc/alias/git-o/index.md delete mode 100644 doc/alias/git-p/index.md delete mode 100644 doc/alias/git-publish-git-unpublish/index.md delete mode 100644 doc/alias/git-pull1/index.md delete mode 100644 doc/alias/git-push1/index.md delete mode 100644 doc/alias/git-r/index.md delete mode 100644 doc/alias/git-rb/index.md delete mode 100644 doc/alias/git-rr/index.md delete mode 100644 doc/alias/git-s/index.md delete mode 100644 doc/alias/git-sb/index.md delete mode 100644 doc/alias/index.md create mode 100644 doc/assets/prism.css create mode 100644 doc/assets/prism.js rename doc/contribute/{contribute.md => index.md} (96%) delete mode 100644 doc/customize/customize.md create mode 100644 doc/customize/index.md rename doc/examples/{examples.md => index.md} (80%) rename doc/{alias => }/git-a/index.md (51%) create mode 100644 doc/git-aa/index.md rename doc/{alias => }/git-add-alias/index.md (96%) create mode 100644 doc/git-add-cached/index.md create mode 100644 doc/git-add-deleted/index.md create mode 100644 doc/git-add-ignored/index.md create mode 100644 doc/git-add-killed/index.md create mode 100644 doc/git-add-modified/index.md create mode 100644 doc/git-add-others/index.md create mode 100644 doc/git-add-stage/index.md create mode 100644 doc/git-add-unmerged/index.md rename doc/{alias => }/git-add/index.md (78%) rename doc/{alias => }/git-aliases/index.md (93%) rename doc/{alias => }/git-ap/index.md (61%) rename doc/{alias => }/git-archive/index.md (92%) create mode 100644 doc/git-assume-all/index.md rename doc/{alias/git-assume-git-unassume => git-assume-and-git-unassume}/index.md (95%) create mode 100644 doc/git-assume/index.md create mode 100644 doc/git-assumed/index.md create mode 100644 doc/git-au/index.html create mode 100644 doc/git-au/index.md create mode 100644 doc/git-b/index.md rename doc/{alias => }/git-bed/index.md (86%) rename doc/{alias => }/git-bm/index.md (68%) rename doc/{alias => }/git-bnm/index.md (58%) create mode 100644 doc/git-branch-commit-first/index.md create mode 100644 doc/git-branch-commit-last/index.md create mode 100644 doc/git-branch-commit-next/index.md create mode 100644 doc/git-branch-commit-prev/index.md create mode 100644 doc/git-branch-commit/index.md rename doc/{alias => }/git-branch-name/index.md (61%) create mode 100644 doc/git-branch/index.md rename doc/{alias => }/git-branches/index.md (94%) rename doc/{alias => }/git-bsd/index.md (93%) create mode 100644 doc/git-bv/index.md create mode 100644 doc/git-bvv/index.md create mode 100644 doc/git-c/index.md create mode 100644 doc/git-ca/index.md create mode 100644 doc/git-cam/index.md rename doc/{alias => }/git-cane/index.md (83%) rename doc/{alias => }/git-chart/index.md (98%) rename doc/{alias => }/git-cherry-pick-merge/index.md (91%) create mode 100644 doc/git-churn/index.html rename doc/{alias => }/git-churn/index.md (93%) rename doc/{alias => }/git-ci/index.md (75%) create mode 100644 doc/git-cleaner/index.html create mode 100644 doc/git-cleaner/index.md rename doc/{alias => }/git-cleanout/index.md (85%) rename doc/{alias => }/git-clone-lean/index.md (97%) rename doc/{alias => }/git-cloner/index.md (83%) rename doc/{alias => }/git-cm/index.md (75%) rename doc/{alias => }/git-co/index.md (81%) rename doc/{alias => }/git-cog/index.md (76%) rename doc/{alias => }/git-commit-is-merge/index.md (90%) rename doc/{alias => }/git-commit-message-key-lines/index.md (94%) rename doc/{alias => }/git-commit-parents/index.md (87%) rename doc/{alias => }/git-cong/index.md (77%) create mode 100644 doc/git-count/index.md rename doc/{alias => }/git-cp/index.md (87%) rename doc/{alias => }/git-cpa/index.md (78%) rename doc/{alias => }/git-cpc/index.md (79%) rename doc/{alias => }/git-cpn/index.md (76%) rename doc/{alias => }/git-cpnx/index.md (90%) create mode 100644 doc/git-cull-branches/index.md rename doc/{alias/git-cull-locals => git-cull-local-branches}/index.md (57%) rename doc/{alias/git-cull-remotes => git-cull-remote-branches}/index.md (66%) create mode 100644 doc/git-cvs-e/index.md create mode 100644 doc/git-cvs-i/index.md rename doc/{alias => }/git-cvs/index.md (85%) create mode 100644 doc/git-d/index.md rename doc/{alias => }/git-dc/index.md (79%) rename doc/{alias => }/git-dd/index.md (87%) rename doc/{alias => }/git-debug/index.md (92%) rename doc/{alias => }/git-default-branch/index.md (83%) create mode 100644 doc/git-diff-all/index.md create mode 100644 doc/git-diff-changes/index.md rename doc/{alias => }/git-diff-chunk/index.md (94%) create mode 100644 doc/git-diff-deep/index.md create mode 100644 doc/git-diff-staged/index.md create mode 100644 doc/git-diff-stat/index.md rename doc/{alias => }/git-diff/index.md (94%) create mode 100644 doc/git-discard/index.md rename doc/{alias => }/git-ds/index.md (77%) create mode 100644 doc/git-dw/index.md rename doc/{alias => }/git-dwd/index.md (78%) create mode 100644 doc/git-edit-cached/index.md create mode 100644 doc/git-edit-deleted/index.md create mode 100644 doc/git-edit-ignored/index.md create mode 100644 doc/git-edit-killed/index.md create mode 100644 doc/git-edit-modified/index.md create mode 100644 doc/git-edit-others/index.md create mode 100644 doc/git-edit-stage/index.md create mode 100644 doc/git-edit-unmerged/index.md rename doc/{alias => }/git-edit/index.md (97%) create mode 100644 doc/git-exec/index.html rename doc/{alias => }/git-exec/index.md (85%) create mode 100644 doc/git-expunge/index.html rename doc/{alias => }/git-expunge/index.md (95%) create mode 100644 doc/git-f/index.md create mode 100644 doc/git-fa/index.md create mode 100644 doc/git-fav/index.md rename doc/{alias => }/git-fixup/index.md (92%) rename doc/{alias => }/git-g/index.md (72%) rename doc/{alias => }/git-get-git-put/index.md (78%) create mode 100644 doc/git-get/index.md rename doc/{alias => }/git-gg/index.md (87%) rename doc/{alias => }/git-gitk-conflict/index.md (84%) rename doc/{alias => }/git-gitk-history-all/index.md (69%) create mode 100644 doc/git-gitk/index.md rename doc/{alias => }/git-gn/index.md (80%) rename doc/{alias => }/git-graphviz/index.md (91%) create mode 100644 doc/git-grep-ack/index.md create mode 100644 doc/git-grep-all/index.md create mode 100644 doc/git-grep-group/index.md rename doc/{alias => }/git-grep/index.md (95%) create mode 100644 doc/git-heads/index.md create mode 100644 doc/git-ignore/index.md rename doc/{alias => }/git-inbound/index.md (87%) create mode 100644 doc/git-init-empty/index.md rename doc/{alias => }/git-intercommit/index.md (93%) rename doc/{alias => }/git-issues/index.md (92%) create mode 100644 doc/git-l/index.md create mode 100644 doc/git-last-tag/index.md create mode 100644 doc/git-last-tagged/index.md rename doc/{alias => }/git-lfp/index.md (86%) rename doc/{alias => }/git-lg/index.md (82%) rename doc/{alias => }/git-ll/index.md (87%) rename doc/{alias => }/git-lll/index.md (89%) rename doc/{alias => }/git-lo/index.md (75%) create mode 100644 doc/git-log-1-day/index.md create mode 100644 doc/git-log-1-hour/index.md create mode 100644 doc/git-log-1-month/index.md create mode 100644 doc/git-log-1-week/index.md create mode 100644 doc/git-log-1-year/index.md create mode 100644 doc/git-log-date-first/index.md create mode 100644 doc/git-log-date-last/index.md create mode 100644 doc/git-log-fetched/index.md create mode 100644 doc/git-log-fresh/index.md create mode 100644 doc/git-log-graph/index.md create mode 100644 doc/git-log-like-long/index.md create mode 100644 doc/git-log-like/index.md create mode 100644 doc/git-log-my-day/index.md create mode 100644 doc/git-log-my-hour/index.md create mode 100644 doc/git-log-my-month/index.md create mode 100644 doc/git-log-my-week/index.md create mode 100644 doc/git-log-my-year/index.md create mode 100644 doc/git-log-my/index.md create mode 100644 doc/git-log-of-count-and-day-of-week/index.md create mode 100644 doc/git-log-of-count-and-day/index.md create mode 100644 doc/git-log-of-count-and-email/index.md create mode 100644 doc/git-log-of-count-and-format-with-date/index.md create mode 100644 doc/git-log-of-count-and-format/index.md create mode 100644 doc/git-log-of-count-and-hour-of-day/index.md create mode 100644 doc/git-log-of-count-and-hour/index.md create mode 100644 doc/git-log-of-count-and-month/index.md create mode 100644 doc/git-log-of-count-and-week-of-year/index.md create mode 100644 doc/git-log-of-count-and-week/index.md create mode 100644 doc/git-log-of-count-and-year/index.md create mode 100644 doc/git-log-of-day-and-count/index.md create mode 100644 doc/git-log-of-day-of-week-and-count/index.md create mode 100644 doc/git-log-of-email-and-count/index.md create mode 100644 doc/git-log-of-format-and-count-with-date/index.md create mode 100644 doc/git-log-of-format-and-count/index.md create mode 100644 doc/git-log-of-hour-and-count/index.md create mode 100644 doc/git-log-of-hour-of-day-and-count/index.md create mode 100644 doc/git-log-of-month-and-count/index.md create mode 100644 doc/git-log-of-week-and-count/index.md create mode 100644 doc/git-log-of-week-of-year-and-count/index.md create mode 100644 doc/git-log-of-year-and-count/index.md rename doc/{alias/git-log => git-log-of}/index.md (52%) create mode 100644 doc/git-log-refs/index.md create mode 100644 doc/git-log-timeline/index.md create mode 100644 doc/git-log/index.md create mode 100644 doc/git-lor/index.md rename doc/{alias => }/git-lp/index.md (75%) rename doc/{alias => }/git-ls/index.md (81%) rename doc/{alias => }/git-lsd/index.md (78%) rename doc/{alias => }/git-lsfn/index.md (78%) rename doc/{alias => }/git-lsio/index.md (93%) rename doc/{alias => }/git-lto/index.md (88%) create mode 100644 doc/git-m/index.md rename doc/{alias => }/git-ma/index.md (78%) create mode 100644 doc/git-mainly/index.md rename doc/{alias => }/git-mc/index.md (79%) rename doc/{alias => }/git-merge-safe/index.md (96%) create mode 100644 doc/git-merge-span-diff/index.md create mode 100644 doc/git-merge-span-difftool/index.md create mode 100644 doc/git-merge-span-log/index.md rename doc/{alias => }/git-merge-span/index.md (76%) create mode 100644 doc/git-mncnf/index.md rename doc/{alias => }/git-move-alias/index.md (97%) create mode 100644 doc/git-my-branch/index.md create mode 100644 doc/git-o/index.md rename doc/{alias => }/git-optimizer/index.md (84%) rename doc/{alias => }/git-orphans/index.md (88%) rename doc/{alias => }/git-ours-git-theirs/index.md (71%) create mode 100644 doc/git-ours/index.md rename doc/{alias => }/git-outbound/index.md (70%) create mode 100644 doc/git-p/index.md rename doc/{alias => }/git-panic/index.md (87%) rename doc/{alias => }/git-pf/index.md (80%) rename doc/{alias => }/git-pp/index.md (98%) rename doc/{alias => }/git-pr/index.md (94%) rename doc/{alias => }/git-pruner/index.md (92%) create mode 100644 doc/git-publish-git-unpublish/index.html create mode 100644 doc/git-publish-git-unpublish/index.md create mode 100644 doc/git-publish/index.md create mode 100644 doc/git-pull1/index.md create mode 100644 doc/git-push1/index.md create mode 100644 doc/git-pushy/index.md create mode 100644 doc/git-put/index.md create mode 100644 doc/git-rb/index.md rename doc/{alias => }/git-rba/index.md (79%) rename doc/{alias => }/git-rbc/index.md (88%) rename doc/{alias => }/git-rbi/index.md (82%) rename doc/{alias => }/git-rbiu/index.md (90%) rename doc/{alias => }/git-rbs/index.md (84%) create mode 100644 doc/git-rebase-branch/index.md rename doc/{alias => }/git-rebase-interactive-branch/index.md (89%) create mode 100644 doc/git-rebase-recent/index.md create mode 100644 doc/git-ref-recent/index.md rename doc/{alias => }/git-refs-by-date/index.md (89%) rename doc/{alias => }/git-reincarnate/index.md (95%) create mode 100644 doc/git-remote-ref/index.md rename doc/{alias => }/git-remotes-prune/index.md (83%) rename doc/{alias => }/git-remotes-push/index.md (64%) rename doc/{alias => }/git-repacker/index.md (93%) create mode 100644 doc/git-reset-commit-hard-clean/index.md create mode 100644 doc/git-reset-commit-hard/index.md create mode 100644 doc/git-reset-commit/index.md create mode 100644 doc/git-reset-to-pristine/index.md create mode 100644 doc/git-reset-to-upstream/index.md rename doc/{alias => }/git-reset/index.md (82%) rename doc/{alias => }/git-rev-list-all-objects-by-size-and-name/index.md (94%) rename doc/{alias => }/git-rev-list-all-objects-by-size/index.md (91%) rename doc/{alias => }/git-rl/index.md (70%) create mode 100644 doc/git-rr/index.md rename doc/{alias => }/git-rrp/index.md (82%) rename doc/{alias => }/git-rrs/index.md (81%) rename doc/{alias => }/git-rru/index.md (85%) rename doc/{alias => }/git-rv/index.md (66%) rename doc/{alias => }/git-rvnc/index.md (68%) create mode 100644 doc/git-s/index.md create mode 100644 doc/git-sb/index.md rename doc/{alias => }/git-sbdo/index.md (81%) rename doc/{alias => }/git-sbto/index.md (80%) rename doc/{alias => }/git-search-commits/index.md (75%) rename doc/{alias => }/git-serve/index.md (91%) create mode 100644 doc/git-show-unreachable/index.md rename doc/{alias => }/git-sm/index.md (73%) rename doc/{alias => }/git-sma/index.md (80%) rename doc/{alias => }/git-smi/index.md (81%) rename doc/{alias => }/git-sms/index.md (81%) rename doc/{alias => }/git-smu/index.md (81%) rename doc/{alias => }/git-smui/index.md (80%) rename doc/{alias => }/git-smuir/index.md (90%) rename doc/{alias => }/git-snapshot/index.md (93%) rename doc/{alias => }/git-ss/index.md (75%) rename doc/{alias => }/git-ssb/index.md (80%) rename doc/{alias => }/git-stashes/index.md (92%) create mode 100644 doc/git-submodule/index.md rename doc/{alias => }/git-summary/index.md (98%) create mode 100644 doc/git-svn-b/index.md create mode 100644 doc/git-svn-c/index.md create mode 100644 doc/git-svn-cp/index.md create mode 100644 doc/git-svn-m/index.md rename doc/{alias => }/git-svn/index.md (89%) rename doc/{alias => }/git-tags/index.md (92%) create mode 100644 doc/git-theirs/index.md rename doc/{alias/git-top-name => git-top}/index.md (50%) rename doc/{alias/git-topic-branch => git-topic-base}/index.md (88%) rename doc/{alias/git-topic-start => git-topic-begin}/index.md (77%) rename doc/{alias/git-topic-stop => git-topic-end}/index.md (81%) rename doc/{alias => }/git-topic-move/index.md (87%) rename doc/{alias => }/git-topic-sync/index.md (84%) rename doc/{alias => }/git-topic/index.md (61%) rename doc/{alias => }/git-track-all-remote-branches/index.md (93%) rename doc/{alias => }/git-track/index.md (92%) rename doc/{alias => }/git-unadd/index.md (78%) create mode 100644 doc/git-unassume-all/index.md create mode 100644 doc/git-unassume/index.md rename doc/{alias => }/git-uncommit/index.md (78%) create mode 100644 doc/git-undo-commit-hard-clean/index.md create mode 100644 doc/git-undo-commit-hard/index.md create mode 100644 doc/git-undo-commit/index.md create mode 100644 doc/git-undo-to-pristine/index.md create mode 100644 doc/git-undo-to-upstream/index.md rename doc/{alias => }/git-undo/index.md (76%) create mode 100644 doc/git-unpublish/index.md rename doc/{alias => }/git-untrack/index.md (70%) create mode 100644 doc/git-unwip/index.md rename doc/{alias => }/git-upstream-branch/index.md (50%) rename doc/{alias => }/git-w/index.md (58%) rename doc/{alias => }/git-whatis/index.md (85%) rename doc/{alias => }/git-who/index.md (85%) rename doc/{alias => }/git-whois/index.md (87%) rename doc/{alias => }/git-wip-git-unwip/index.md (87%) create mode 100644 doc/git-wip/index.md create mode 100644 doc/index.html create mode 100644 doc/index.md delete mode 100644 doc/index/index.md rename doc/install/{install.md => index.md} (92%) rename doc/introduction/{introduction.md => index.md} (90%) rename doc/more/{more.md => index.md} (89%) create mode 100644 doc/site/templates/template.html rename doc/thanks/{thanks.md => index.md} (96%) rename doc/todo/{todo.md => index.md} (95%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 89bedcf8..ffbb5cb2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,30 @@ We welcome people contributing in many ways: * Spread the word about us: http://gitalias.com +## Advice + +Typically a short alias for a command and its options +should be in the same order as the command and option words: + + * Right: `fab = foo --alpha --bravo` + + * Wrong: `baf = foo --alpha --bravo` + +Typically a short alias for a command and its options +should be using the first letter of each option word: + + * Right: `fab = foo --alpha-bravo` + + * Wrong: `fa = foo --alpha-bravo` + +One-letter aliases never use options, because we want +the aliases to be as easy as possible to compose: + + * Right: `s = status` + + * Wrong: `s = status --alpha --bravo` + + ## Conventions Conventions for coding: @@ -36,7 +60,7 @@ We want this project to be good for teams: Because we want widespread usability, we do not include everything possible: - * For example, we do not have a one-letter shortcut for `git push` + * For example, we do not have a one-letter short alias for `git push` because we have not found a widespread consensus among developers. We prefer using higher-level capabilities, such as a git hook that watches for a commit, then does an automatic push to a CI/CD server. diff --git a/README.md b/README.md index 26fbeea6..ce9ba477 100644 --- a/README.md +++ b/README.md @@ -1,430 +1,672 @@ -# Git Alias +# GitAlias -This project provides many git alias commands that you can use as you wish.. +This project provides many git alias commands that you can use as you like. Contents: -* [Introduction](#introduction) - * [What is Git Alias?](#what-is-git-alias) - * [Where is the code?](#where-is-the-code) - * [Why use this?](#why-use-this) -* [Install](#install) - * [Install with typical usage](#install-with-typical-usage) - * [Install with custom usage](#install-with-custom-usage) -* [Examples](#examples) - * [Shortcut examples](#shortcut-examples) - * [Popular examples](#popular-examples) - * [Accelerator examples](#accelerator-examples) - * [Recovery examples](#recovery-examples) - * [Coordination examples](#coordination-examples) - * [Workflow examples](#workflow-examples) - * [Optimization examples](#optimization-examples) -* [Customization](#customization) - * [Status](#status) - * [Log](#log) - * [Format](#format) -* [Contributor advice](#contributor-advice) -* [Epilog](#epilog) - * [See also](#see-also) - * [To do](#to-do) - * [Thanks](#thanks) +* [What is GitAlias?](#what-is-git-alias) +* [Why use GitAlias?](#why-use-gitalias) +* [Download, install, customize](#download-install-customize) +* [Short aliases](#short-aliases) +* [Topic aliases](#topic-aliases) +* [Friendly aliases](#friendly-aliases) +* [Convenience alaises](#convenience-alaises) +* [Workflow aliases](#workflow-aliases) +* [Tooling aliases](#tooling-aliases) +* [Index of all aliases](#index-of-all-aliases) +* [Contribute](CONTRIBUTING.md) +* [More ideas](doc/more/index.md) +* [To do](doc/todo/index.md) +* [Thanks](doc/thanks/index.md) +* [Tracking](#tracking) -## Introduction +## What is GitAlias? +GitAlias is a collection of git version control alias helpers: -### What is Git Alias? + * Shortcuts such as [`ss = status --short`](doc/git-ss/index.md), [`ca = commit --amend`](doc/git-ca/index.md), [`lg = log --graph`](doc/git-lg/index.md). -Git Alias is a collection of git version control shortcuts, functions, and commands: + * Searches such as [`grep-all`](doc/grep-all), [`whois`](doc/git-who/index.md), [`whatis`](doc/git-whatis/index.md). - * Shortcuts such as `s` for `status`. + * Reports such as [`chart`](doc/git-chart/index.md), [`summary`(doc/git-summary/index.md), [`log-my-week`](doc/git-log-my-week/index.md). - * Improvements such as `optimize` to do a prune and repack with recommended settings. + * Commands such as [`optimizer`](doc/git-optimizer/index.md), [`archive`](doc/git-archive/index.md), [`reincarnate`](doc/reincarnate/index.md). - * Workflows such as `topic-start` to create a new topic branch for a new feature. + * Workflows such as [`get`](doc/git-get/index.md)/[`put`](doc/git-put/index.md), [`publish`](doc/git-publish/index.md)/[`unpublish`](doc/git-unpublish/index.md), [`topic-begin`](doc/git-topic-begin/index.md)/[`topic-end`](doc/git-topic-end/index.md). - * Visualizations such as `graphviz` to show logs and charts using third-party tools. +### Why use GitAlias? -### Where is the code? +Because it makes your work faster, more streamlined, and more powerful. -To see the complete code, view this file: +Because when you work on multiple teams, it's very helpful to count on consistent git aliases. For shorter commands, such as `s` for `status`, fast speed is nice. For longer commands, such as `repacker`, accurate settings are important. - * [gitalias.txt](gitalias.txt) +## Download, install, customize -### Why use this? +* Download the GitAlias source code all in one file: [gitalias.txt](gitalias.txt) -We are creating this alias list because we type these commands many times daily, and we want the commands to be fast and also accurate. +* Install GitAlias using a variety of ways: [install guide](doc/install/index.md). -We often work on teams, across many companies and organizations, and using multiple shells. We want to count on a set of aliases. For shorter commands, such as `s` for `status`, fast speed is nice. For longer commands, such as `repacker`, accurate settings are important. +* Customize the aliases as you wish: [customize guide](doc/customize/index.md). +You can also follow us on GitHub: +* GitAlias account: [https://github.com/gitalias](https://github.com/gitalias) -## Install +* GitAlias repository: [https://github.com/gitalias/gitalias](https://github.com/gitalias/gitalias) -### Install with typical usage +## Short aliases -Download the file [`gitalias.txt`](gitalias.txt) and include it: +Short aliases are for frequent commands and options: -```sh -curl https://raw.githubusercontent.com/GitAlias/gitalias/main/gitalias.txt -o ~/.gitalias -git config --global include.path ~/.gitalias -``` +git add: +* [git a](doc/git-a/index.md/index.md) = add +* [git aa](doc/git-aa/index.md) = add --all +* [git ap](doc/git-ap/index.md) = add --patch +* [git au](doc/git-au/index.md) = add --update -### Install with custom usage +git branch: -Download the file [`gitalias.txt`](gitalias.txt) any way you want, such as: +* [git b](doc/git-b/index.md/index.md) = branch +* [git bm](doc/git-bm/index.md) = branch --merged +* [git bnm](doc/git-bnm/index.md) = branch --no-merged +* [git bed](doc/git-bed/index.md) = branch --edit-description +* [git bsd](doc/git-bsd/index.md) = branch --show-description (polyfill) -```sh -curl -O https://raw.githubusercontent.com/GitAlias/gitalias/main/gitalias.txt -``` +git commit: -Manually edit your git config dot file any way you want, such as: +* [git c](doc/git-c/index.md/index.md) = commit +* [git ca](doc/git-ca/index.md) = commit --amend +* [git cam](doc/git-cam/index.md) = commit --amend --message +* [git cane](doc/git-cane/index.md) = commit --amend --no-edit +* [git ci](doc/git-ci/index.md) = commit --interactive +* [git cm](doc/git-cm/index.md) = commit --message -```sh -vi ~/.gitconfig -``` +git checkout: -Include the path to this file: +* [git co](doc/git-co/index.md) = checkout +* [git cog](doc/git-cog/index.md) = checkout --guess +* [git cong](doc/git-cong/index.md) = checkout --no-guess -```toml -[include] -path = ~/.gitalias -``` +git cherry-pick: +* [git cp](doc/git-cp/index.md) = cherry-pick +* [git cpa](doc/git-cpa/index.md) = cherry-pick --abort +* [git cpc](doc/git-cpc/index.md) = cherry-pick --continue +* [git cpn](doc/git-cpn/index.md) = cherry-pick -n (--no-commit) +* [git cpnx](doc/git-cpnx/index.md) = cherry-pick -n -x (--no-commit and with a message) -## Examples +git diff: +* [git d](doc/git-d/index.md/index.md) = diff +* [git dd](doc/git-dd/index.md) = diff with our preferred settings +* [git dc](doc/git-dc/index.md) = diff --cached +* [git ds](doc/git-ds/index.md) = diff --staged +* [git dwd](doc/git-dwd/index.md) = diff --word-diff -### Shortcut examples +git fetch: -Letters: +* [git f](doc/git-f/index.md/index.md) = fetch -```gitalias -a = add +git grep: -b = branch +* [git g](doc/git-g/index.md/index.md) = grep +* [git gg](doc/git-gg/index.md) = grep with our preferred settings +* [git gn](doc/git-gn/index.md) = grep -n (--line-number) -c = commit -``` +git log: -Letters with options: +* [git l](doc/git-l/index.md/index.md) = log +* [git ll](doc/git-ll/index.md) = log with our preferred short settings +* [git lll](doc/git-lll/index.md) = log with our preferred long settings +* [git lg](doc/git-lg/index.md) = log --graph +* [git lo](doc/git-lo/index.md) = log --oneline +* [git lor](doc/git-lor/index.md) = log --oneline --reverse +* [git lp](doc/git-lp/index.md) = log --patch +* [git lfp](doc/git-lfp/index.md) = log --first-parent +* [git lto](doc/git-lto/index.md) = log --topo-order -```gitalias -ap = add --patch +git ls-files: -bm = branch --merged +* [git ls](doc/git-ls/index.md) = ls-files +* [git lsd](doc/git-lsd/index.md) = ls-files --debug +* [git lsfn](doc/git-lsfn/index.md) = ls-files --full-name +* [git lsio](doc/git-lsio/index.md) = ls-files --ignored --others --exclude-standard -ci = commit --interactive -``` +git merge: +* [git m](doc/git-m/index.md/index.md) = merge +* [git ma](doc/git-ma/index.md) = merge --abort +* [git mc](doc/git-mc/index.md) = merge --continue +* [git me](doc/git-me/index.md) = merge --no-commit --no-ff -### Popular examples +git pull: -Summarizing: +* [git pf](doc/git-pf/index.md) - git pull with fast-forward only +* [git pr](doc/git-pr/index.md) - git pull with rebase +* [git pp](doc/git-pp/index.md) - git pull with rebase preserve of merge commits -```gitalias -dd = diff --check --dirstat --find-copies --find-renames --histogram --color +git rebase: -ll = log --graph --topo-order --abbrev-commit --date=short --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset' -``` +* [git rb](doc/git-rb/index.md) = rebase +* [git rba](doc/git-rb/index.md) = rebase --abort +* [git rbc](doc/git-rbc/index.md) = rebase --continue +* [git rbs](doc/git-rbs/index.md) = rebase --skip +* [git rbi](doc/git-rbi/index.md) = rebase --interactive +* [git rbiu](doc/git-rbiu/index.md) = rebase --interactive @{upstream} -Committing: +git reflog: -```gitalias -cam = commit --amend --message +* [git rl](doc/git-rl/index.md) = reflog -rbi = rebase --interactive @{upstream} -``` +git remote: +* [git rr](doc/git-rr/index.md) = remote +* [git rrs](doc/git-rrs/index.md) = remote show +* [git rru](doc/git-rru/index.md) = remote update +* [git rrp](doc/git-rrp/index.md) = remote prune -### Accelerator examples +git revert: -Logging: +* [git rv](doc/git-rv/index.md) = revert +* [git rvnc](doc/git-rvnc/index.md) = revert --no-commit -```gitalias -log-graph = log --graph --all --decorate --oneline +git show-branch: -log-my-week = !git log --author $(git config user.email) --since "1 week ago" -``` +* [git sb](doc/git-sb/index.md) = show-branch +* [git sbdo](doc/git-sbdo/index.md) = show-branch --date-order +* [git sbto](doc/git-sbto/index.md) = show-branch --topo-order -Searching: +git submodule: -```gitalias -grep-group = grep --break --heading --line-number +* [git sm](doc/git-sm/index.md) = submodule +* [git smi](doc/git-smi/index.md) = submodule init +* [git sma](doc/git-sma/index.md) = submodule add +* [git sms](doc/git-sms/index.md) = submodule sync +* [git smu](doc/git-smu/index.md) = submodule update +* [git smui](doc/git-smui/index.md) = submodule update --init +* [git smuir](doc/git-smuir/index.md) = submodule update --init --recursive -grep-all = !"git rev-list --all | xargs git grep '$1'" -``` +git status: +* [git s](doc/git-s/index.md/index.md) = status +* [git ss](doc/git-ss/index.md) = status --short +* [git ssb](doc/git-ssb/index.md) = status --short --branch -### Recovery examples +git whatchanged: -Backtracking: +* [git w](doc/git-w/index.md/index.md) = whatchanged -```gitalias -uncommit = reset --soft HEAD~1 -cleanout = !git clean -df && git checkout -- . -``` +## Topic aliases -Preserving: +Topic aliases for creating topic branches, such as to add a feature, fix a bug, document a capabilty, etc. -```gitalias -snapshot = !git stash push "snapshot: $(date)" && git stash apply "stash@{0}" +* [git topic-*](doc/git-topic/index.md) - Read this first about topic aliases. +* [git topic-base](doc/git-topic-base/index.md) - Show the topic base branch name +* [git topic-begin](doc/git-topic-begin/index.md) - Start a new topic branch +* [git topic-end](doc/git-topic-end/index.md) - Finish the current topic branch +* [git topic-sync](doc/git-topic-sync/index.md) - Synchronize the current topic branch +* [git topic-move](doc/git-topic-move/index.md) - Rename the current topic branch -archive = !"f() { top=$(rev-parse --show-toplevel); cd $top; tar cvf $top.tar $top ; }; f" -``` +## Friendly aliases -### Traversal examples +Start: -Find the branch's previous commit hash: +* [git init-empty](doc/git-init-empty/index.md) - Initialize a repo with an empty rebaseable commit +* [git cloner](doc/git-cloner/index.md) - Clone a repo and recurse on any of its submodules -```gitalias -git branch-commit-prev -``` +Branch names: -Find the branch's next commit hash: +* [git default-branch](doc/git-default-branch/index.md) - Get the default branch name +* [git my-branch](doc/git-my-branch/index.md) - Get my current local branch name +* [git upstream-branch](doc/git-upstream-branch/index.md) - Get the upstream branch name +* [git topic-base](doc/git-topic-base/index.md) - Get the topic branch name -```gitalias -git branch-commit-next -``` +Branch commits: +* [git branch-commit-first](../git-branch-commit-first) - Show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last) - Show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev) - Show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next) - Show a branch's next commit hash (or hashes) -### Coordination examples +List items: -Combining: +* [git aliases](doc/git-aliases/index.md) - List aliases +* [git branches](doc/git-branches/index.md) - List branches +* [git tags](doc/git-tags/index.md) - List tags +* [git stashes](doc/git-stashes/index.md) - List stashes -```gitalias -ours = !"f() { git checkout --ours $@ && git add $@; }; f" +Undo: -theirs = !"f() { git checkout --theirs $@ && git add $@; }; f" -``` +* [git uncommit](doc/git-uncommit/index.md) = reset --soft HEAD~1 +* [git unadd](doc/git-unadd/index.md) = reset HEAD -Comparing: -```gitlias -incoming = !git remote update --prune; git log ..@{upstream} +## Convenience alaises -outgoing = log @{upstream}.. -``` +Logging & reporting: +* [git log-*](doc/git-log/index.md) (many aliases) +* [git who](doc/git-who/index.md) +* [git chart](doc/git-chart/index.md) +* [git churn](doc/git-churn/index.md) +* [git summary](doc/git-summary/index.md) -### Workflow examples +Lookups: -Synchronizing: +* [git whois](doc/git-whois/index.md) - Try to figure out an author's information +* [git whatis](doc/git-whatis/index.md) - Try to figure out an object's information -```gitalias -get = !git fetch --prune && git pull --rebase=preserve && git submodule update --init --recursive +Commit details: -put = !git commit --all && git push -``` +* [git commit-parents](doc/git-commit-parents/index.md) - Show the commit's parents +* [git commit-is-merge](doc/git-commit-is-merge/index.md) - Is the commit a merge commit? +* [git commit-message-key-lines](doc/git-commit-message-key-lines/index.md) -Publishing: +Add all & edit all: -```gitalias -publish = "!git push -u origin $(git current-branch)" +* [git add-*](doc/git-edit/index.md) - Add all files of a given type +* [git edit-*](doc/git-edit/index.md) - Edit all files of a given type -unpublish = "!git push origin :$(git current-branch)" -``` +Alias helpers: -Branching: +* [git add-alias](doc/git-add-alias/index.md) - Create a new git alias +* [git move-alias](doc/git-move-alias/index.md) - Rename an existing git alias -```gitalias -topic-start = "!f(){ b=$1; git checkout main; git fetch; git rebase; git checkout -b "$b" main; };f" +Script helpers: -topic-stop = "!f(){ b=$1; git checkout main; git branch -d "$b"; git push origin ":$b"; };f" -``` +* [git top](doc/git-top/index.md) - Get the top level directory name +* [git exec](doc/git-exec/index.md) - Execute a shell script +Remotes: -### Optimization examples +* [git remotes-prune](doc/git-remotes-prune/index.md) - For each remote branch, prune it +* [git remotes-push](doc/git-remotes-push/index.md) - For each remote branch, push it -Naming: +Misc: -```gitalias -top-name = rev-parse --show-toplevel +* [git diff-*](doc/git-diff/index.md) +* [git grep-*](doc/git-grep/index.md) +* [git merge-span-*](doc/git-merge-span/index.md) - Merge span aliases +* [git orphans](doc/git-orphans/index.md) - Find all objects that aren't referenced by any other object +* [git fixup](doc/git-fixup/index.md) - Fix a commit by amending it +* [git rev-list-all-objects-by-size](doc/git-rev-list-all-objects-by-size/index.md) +* [git rev-list-all-objects-by-size-and-name](doc/git-rev-list-all-objects-by-size-and-name/index.md) +* [git cherry-pick-merge](doc/git-cherry-pick-merge/index.md) +* [git refs-by-date](doc/git-refs-by-date/index.md) - Sort by date for branches -branch-name = rev-parse --abbrev-ref HEAD +Advanced aliases: -upstream-name = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) -``` +* [git search-commits](doc/git-search-commits/index.md) +* [git debug](doc/git-debug/index.md) +* [git intercommit](doc/git-intercommit/index.md) -Pluralizing: -```gitalias -branches = branch -a +## Workflow aliases -stashes = stash list +Starting: -tags = tag -n1 --list -``` +* [git init-empty](doc/git-init-empty/index.md) - Initialize a repo with an empty rebaseable commit +* [git cloner](doc/git-cloner/index.md) - Clone a repo and recurse on any of its submodules +* [git clone-lean](doc/git-clone-lean/index.md) - Clone a repo as lean as possible -Streamlining: +Save: -```gitalias -pruner = !git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all +* [git archive](doc/git-archive/index.md) - Create an archive file of everything in the repo +* [git snapshot](doc/git-snapshot/index.md) - Stash a snapshot of your current working tree +* [git panic](doc/git-panic/index.md) - When you're worried the world is coming to an end -repacker = !git repack -a -d -f --depth=300 --window=300 --window-memory=1g +Flow aliases: -expunge = !"f() { git filter-branch --force --index-filter \"git rm --cached --ignore-unmatch $1\" --prune-empty --tag-name-filter cat -- --all }; f" -``` +* [git get & git put](doc/git-get-git-put/index.md) +* [git ours & git theirs](doc/git-ours-git-theirs/index.md) +* [git wip & git unwip](doc/git-wip-git-unwip/index.md) +* [git assume & git unassume](doc/git-assume-and-git-unassume/index.md) +* [git publish & git unpublish](doc/git-publish-git-unpublish/index.md) +reset & undo: -## Customization +* [git reset-*](doc/git-reset/index.md) - Move backwards on the commit chain; synonym for undo-* +* [git undo-*](doc/git-undo/index.md) - Move backwards on the commit chain; synonym for reset-* +track & untrack: -If you want to use this file, and also want to change some of the items, -then one way is to use your git config file to include this gitalias file, -and also define your own alias items; a later alias takes precedence. +* [git track](doc/git-track/index.md) - Start tracking from a local branch to upstream branch +* [git untrack](doc/git-untrack/index.md) - Stop tracking from a local branch to upstream branch -This section has examples that include this file, then add a customization. +inbound & outbound: +* [git inbound](doc/git-inbound/index.md) - Show incoming changes compared to upstream +* [git outbound](doc/git-outbound/index.md) - Show outgoing changes compared to upstream -### Status +pull1 & push1: -To do your own custom terse status messages: +* [git pull1](doc/git-pull1/index.md) - Pull just the current branch +* [git push1](doc/git-push1/index.md) - Push just the current branch -```gitalias -[include] -path = ~/.gitalias -[alias] -s = status -sb -``` +Cull: - -### Log - -To do your own custom log summaries: - -```gitalias -[include] -path = ~/.gitalias - -[alias] -l = log --graph --oneline -``` - -### Format - -To do your own custom pretty formatting: - -```gitalias -[include] -path = ~/.gitalias - -[format] -pretty = "%H %ci %ce %ae %d %s" -``` - - -## Contributor advice - -Typically a short alias for a command and its options -is in the same order as the command and option words: - - * Right: `fab = foo --alpha --bravo` - - * Wrong: `baf = foo --alpha --bravo` - - * Wrong: `abf = foo --alpha --bravo` - -Typically a short alias for a command and its options -uses the first letter of each option word: - - * Right: `fab = foo --alpha-bravo` - - * Wrong: `fa = foo --alpha-bravo` - - * Wrong: `fb = foo --alpha-bravo` - - -## Epilog - - -### See also - -More ideas for git improvements: - - * If you want to alias the git command, then use your shell, such as `alias g=git`. - - * If you want history views, see [git-recall](https://github.com/Fakerr/git-recall) - - * If you use `oh-my-zsh`, then you may like the git [plugin](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git) - - * If you use `vim` then see [Fugitive](https://github.com/tpope/vim-fugitive) - - * If you use `emacs` then see [Magit](https://magit.vc/) - - * If you use git shell scripting then see [SCM Breeze](https://github.com/ndbroadbent/scm_breeze) - - * If you use `node` then see [git-alias](https://www.npmjs.com/package/git-alias) - -For more git config ideas, and for credit for many of the aliases here, please see these excelent resources: - - * - - * - - * - - * - - * - - * - - * - - * - - * - - * [Human Git Aliases](http://gggritso.com/human-git-aliases) - -References: - - * [Git Basics - Git Aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases) - - * [Git Basics - Tips and Tricks](https://git-scm.com/book/en/v1/Git-Basics-Tips-and-Tricks) - - - - - - -### Thanks - -Thanks to all the contributors, including all the creators of the projects mentioned above. - -Thanks to these people for extra help, in alphabetic order: - - * [Alberto Gregorio](https://github.com/marsop) - * [Berkin Berkcan Çırak](https://github.com/berkin) - * [Bill Lazar](https://github.com/billsaysthis) - * [Corey Haines](http://coreyhaines.com/) - * [Erik Martin-Dorel](https://github.com/erikmd) - * [Gareth Owen](https://github.com/gwjo) - * [Gary Bernhardt](http://destroyallsoftware.com) - * [Jeff Wu](https://github.com/WuTheFWasThat) - * [Joe Nelson](http://begriffs.com) - * [Joe Nelson](https://github.com/begriffs) - * [Joel Parker Henderson](https://github.com/joelparkerhenderson) - * [Kobus Jooste](https://github.com/kobusjooste) - * [Michael Mior](https://github.com/michaelmior) - * [Michal Jarosz](https://github.com/Mchl) - * [Mislav Marohnić](http://mislav.uniqpath.com/) - * [Nariyasu Heseri](https://github.com/NariyasuHeseri) - * [Nick Kirby](https://github.com/NRKirby) - * [Nick Palmer](https://github.com/nickpalmer) - * [Oleg Broytman](https://github.com/phdru) - * [Rob Kennedy](http://cs.wisc.edu/~rkennedy) - * [Rob Miller](https://github.com/robmiller) - * [Romain Dartigues](https://github.com/romain-dartigues) - * [Ruben Verborgh](http://ruben.verborgh.org) - * [Scott Lindsay](http://stackoverflow.com/users/167384/scott-lindsay) - * [Tsukasa Noguchi](https://github.com/wild-mouse) - * [YantaoZhao](https://github.com/yantaozhao) - * [baudtack](http://baudtack.com) +* [git cull](doc/git-cull/index.md) - Delete all branches that are merged +* [git cull-local-branches](doc/git-cull-local-branches/index.md) - Delete local branches that are merged +* [git cull-remote-branches](doc/git-cull-remote-branches/index.md) - Delete remote branches that are merged + +Maintenance tuning: + +* [git cleaner](doc/git-cleaner/index.md) - Clean the recommend way +* [git pruner](doc/git-pruner/index.md) - Prune the recommened way +* [git repacker](doc/git-repacker/index.md) - Repack the recommended way +* [git optimizer](doc/git-optimizer/index.md) - Optimize the recommended way + +Misc: + +* [git issues](doc/git-issues/index.md) - Show issues that are described in commit messages +* [git expunge](doc/git-expunge/index.md) - Use filter-branch to delete a file everywhere +* [git reincarnate](doc/git-reincarnate/index.md) - Kill a branch then create it anew +* [git diff-chunk](doc/git-diff-chunk/index.md) - Do a diff of two chunks in revisions +* [git last-tag](doc/git-last-tag/index.md) - Show the last tag in the current branch +* [git serve](doc/git-serve/index.md) - Serve the local directory via git server daemon +* [git track-all-remote-branches](doc/git-track-all-remote-branches/index.md) - Track all remote branches +* [git cleanout](doc/git-cleanout/index.md) - Clean and discard changes and untracked files in working tree + + +## Tooling aliases + +Use gitk: + +* [git gitk-conflict](doc/git-gitk-conflict/index.md) - Use gitk to show conflicting merge +* [git gitk-history-all](doc/git-history-all/index.md) - Use gitk to show full history + +Use other version control systems: + +* [git cvs-*](doc/git-cvs/index.md) - Use CVS version control +* [git svn-*](doc/git-svn/index.md) - Use Subversion version control + +Use graphviz: + +* [git graphviz](doc/git-graphviz/index.md) - Use graphviz for display + + +## Index of all aliases + + * [git a](doc/git-a/index.md) - Short for "git add" + * [git aa](doc/git-aa/index.md) - Short for "git add --all" - Add all paths + * [git add-alias](doc/git-add-alias/index.md) - Create a new git alias + * [git add-cached](doc/git-add-cached/index.md) - Add cached files + * [git add-deleted](doc/git-add-deleted/index.md) - Add deleted files + * [git add-ignored](doc/git-add-ignored/index.md) - Add ignored files + * [git add-killed](doc/git-add-killed/index.md) - Add killed files + * [git add-modified](doc/git-add-modified/index.md) - Add modified files + * [git add-others](doc/git-add-others/index.md) - Add other files + * [git add-stage](doc/git-add-stage/index.md) - Add stage files + * [git add-unmerged](doc/git-add-unmerged/index.md) - Add unmerged files + * [git aliases](doc/git-aliases/index.md) - List git aliases + * [git ap](doc/git-ap/index.md) - Short for "git add --patch" - Add by patch + * [git archive](doc/git-archive/index.md) - Create an archive file of everything in the repo + * [git assume-all](doc/git-assume-all/index.md) - Assume all files are unchanged + * [git assume](doc/git-assume/index.md) - Assume files are unchanged + * [git assumed](doc/git-assumed/index.md) - Show which files are assumed + * [git au](doc/git-au/index.md) - Short for "git add --update" + * [git b](doc/git-b/index.md) - Short for "git branch" + * [git bed](doc/git-bed/index.md) - Edit the description of a branch + * [git bm](doc/git-bm/index.md) - List branches whose tips are reachable from the specified commit (HEAD if not specified) + * [git bnm](doc/git-bnm/index.md) - List branches whose tips are not reachable from the specified commit (HEAD if not specified) + * [git branch-commit-first](doc/git-branch-commit-first/index.md) - Show a branch's first commit hash (or hashes) + * [git branch-commit-last](doc/git-branch-commit-last/index.md) - Show a branch's last commit hash (or hashes) + * [git branch-commit-next](doc/git-branch-commit-next/index.md) - Show a branch's next commit hash (or hashes) + * [git branch-commit-prev](doc/git-branch-commit-prev/index.md) - Show a branch's previous commit hash (or hashes) + * [git branch](doc/git-branch/index.md) - Aliases related to git branch + * [git branches](doc/git-branches/index.md) - List branches + * [git bsd](doc/git-bsd/index.md) - Show the description of a branch + * [git bv](doc/git-bv/index.md) - List branch information with hash and subject + * [git bvv](doc/git-bvv/index.md) - List branch information with hash and subject and upstream + * [git c](doc/git-c/index.md) - Short for "git commit" + * [git ca](git-ca) - Amend the tip of the current branch; do not create a new commit + * [git cam](git-cam) - Amend the tip of the current branch; edit the message + * [git cane](doc/git-cane/index.md) - Amend the tip of the current branch; do not edit the message + * [git chart](doc/git-chart/index.md) - Show a summary chart of activity per author + * [git cherry-pick-merge](doc/git-cherry-pick-merge/index.md) - Cherry pick a merge commit + * [git churn](doc/git-churn/index.md) - Show log of files that have many changes + * [git ci](doc/git-ci/index.md) - Commit interactive + * [git cleaner](doc/git-cleaner/index.md) - Use git clean to make everything pristine + * [git cleanout](doc/git-cleanout/index.md) - Clean and discard changes and untracked files in working tree + * [git clone-lean](doc/git-clone-lean/index.md) - Clone as lean as possible + * [git cloner](doc/git-cloner/index.md) - Clone a repository and recurse on any of its submodules + * [git cm](doc/git-cm/index.md) - Commit with a message + * [git co](doc/git-co/index.md) - Checkout a.k.a. update the working tree to match a branch or paths + * [git commit-is-merge](doc/git-commit-is-merge/index.md) - Is the commit a merge commit? If yes exit 0, else exit 1 + * [git commit-message-key-lines](doc/git-commit-message-key-lines/index.md) - Show the commit's keyword-marker lines + * [git commit-parents](doc/git-commit-parents/index.md) - Show the commit's parents + * [git cong](doc/git-cong/index.md) - Checkout with no guessing + * [git count](doc/git-count/index.md) - + * [git cp](doc/git-cp/index.md) - Cherry-pick - apply the changes introduced by some existing commits; + * [git cpa](doc/git-cpa/index.md) - Abort the cherry-pick process + * [git cpc](doc/git-cpc/index.md) - Continue the cherry-pick process + * [git cpn](doc/git-cpn/index.md) - Cherry-pick with no commit + * [git cpnx](doc/git-cpnx/index.md) - Cherry-pick with no commit and with explanation + * [git cull-branches](doc/git-cull-branches/index.md) - Delete branches that have been merged into the upstream commit + * [git cull-local-branches](doc/git-cull-local-branches/index.md) - Delete local branches that have been merged + * [git cull-remote-branches](doc/git-cull-remote-branches/index.md) - Delete remote branches that have been merged into the upstream commit + * [git my-branch](doc/git-my-branch/index.md) - Get my current local branch name + * [git cvs-e](doc/git-cvs-e/index.md) - CVS export + * [git cvs-i](doc/git-cvs-i/index.md) - CVS import + * [git d](doc/git-d/index.md) - Short for "git diff" + * [git dc](doc/git-dc/index.md) - Diff in order to show changes not yet staged + * [git dd](doc/git-dd/index.md) - Diff deep - show changes with our preferred options + * [git debug](doc/git-debug/index.md) - Help debugging builtins + * [git diff-all](doc/git-diff-all/index.md) - For each diff, call difftool + * [git diff-changes](doc/git-diff-changes/index.md) - Show diff of changes + * [git diff-chunk](doc/git-diff-chunk/index.md) - Show the diff of one chunk + * [git diff-deep](doc/git-diff-deep/index.md) - Diff with deep information using our preferred options, a.k.a. `dd` + * [git diff-staged](doc/git-diff-staged/index.md) - Show diffs that are cached i.e. staged + * [git diff-stat](doc/git-diff-stat/index.md) - Diff with stat + * [git discard](doc/git-discard/index.md) - Discard changes in a file (or a list of files) in working tree + * [git ds](doc/git-ds/index.md) - Show changes about to be commited + * [git dw](doc/git-dw/index.md) - Show changes by word, not line + * [git edit-cached](doc/git-edit-cached/index.md) - Edit cached files + * [git edit-deleted](doc/git-edit-deleted/index.md) - Edit deleted files + * [git edit-ignored](doc/git-edit-ignored/index.md) - Edit ignored files + * [git edit-killed](doc/git-edit-killed/index.md) - Edit killed files + * [git edit-modified](doc/git-edit-modified/index.md) - Edit modified files + * [git edit-others](doc/git-edit-others/index.md) - Edit other files + * [git edit-stage](doc/git-edit-stage/index.md) - Edit stage files + * [git edit-unmerged](doc/git-edit-unmerged/index.md) - Edit unmerged files + * [git exec](doc/git-exec/index.md) - Execute a shell script + * [git expunge](doc/git-expunge/index.md) - Delete a file everywhere + * [git f](doc/git-f/index.md) - Short for "git fetch" + * [git fa](doc/git-fa/index.md) - Fetch all remotes + * [git fav](doc/git-fav/index.md) - Fetch all remotes, with verbose output + * [git fixup](doc/git-fixup/index.md) - Fix a commit by amending it + * [git g](doc/git-g/index.md) - Short for "git grep" + * [git get](doc/git-get/index.md) - Get all changes for the current branch + * [git gg](doc/git-gg/index.md) - Grep group i.e. search with our preferred options + * [git gitk-conflict](doc/git-gitk-conflict/index.md) - Use gitk tool to show conflicting merge + * [git gitk-history-all](doc/git-gitk-history-all/index.md) - Use gitk tool to show full history + * [git gn](doc/git-gn/index.md) - Grep and show line number + * [git graphviz](doc/git-graphviz/index.md) - Use graphviz tool for display + * [git grep-ack](doc/git-grep-ack/index.md) - + * [git grep-all](doc/git-grep-all/index.md) - Find text in any commit ever + * [git grep-group](doc/git-grep-group/index.md) - Find text and group the output lines, a.k.a. `gg` + * [git heads](doc/git-heads/index.md) - Show log of heads + * [git ignore](doc/git-ignore/index.md) - Ignore all untracked files by appending them to ".gitignore" + * [git inbound](doc/git-inbound/index.md) - Show incoming changes compared to upstream + * [git init-empty](doc/git-init-empty/index.md) - Initalize a repo with an empty rebaseable commit + * [git intercommit](doc/git-intercommit/index.md) - Use interdiff to see patch modifications + * [git issues](doc/git-issues/index.md) - List all issues mentioned in commit messages between range of commits + * [git item](doc/git-item/index.md) - + * [git l](doc/git-l/index.md) - Short for "git log" + * [git last-tag](doc/git-last-tag/index.md) - Show the last tag in the current branch + * [git last-tagged](doc/git-last-tagged/index.md) - Show the last annotated tag in all branches + * [git lfp](doc/git-lfp/index.md) - Log with first parent + * [git lg](doc/git-lg/index.md) - Log with a text-based graphical representation of the commit history + * [git ll](doc/git-ll/index.md) - Log love - our preferred way key performance indicators + * [git lll](doc/git-lll/index.md) - Log love long i.e. our preferred key performance indicators + * [git lo](doc/git-lo/index.md) - Log with one line per item + * [git log-1-day](doc/git-log-1-day/index.md) - Show log with the recent day + * [git log-1-hour](doc/git-log-1-hour/index.md) - Show log with the recent hour + * [git log-1-month](doc/git-log-1-month/index.md) - Show log with the recent month + * [git log-1-week](doc/git-log-1-week/index.md) - Show log with the recent week + * [git log-1-year](doc/git-log-1-year/index.md) - Show log with the recent year + * [git log-date-first](doc/git-log-date-first/index.md) - Show the date of the earliest commit, in strict ISO 8601 format + * [git log-date-last](doc/git-log-date-last/index.md) - Show the date of the latest commit, in strict ISO 8601 format + * [git log-fetched](doc/git-log-fetched/index.md) - Show log of fetched commits vs. origin/main + * [git log-fresh](doc/git-log-fresh/index.md) - Show log of new commits after you fetched, with stats, excluding merges + * [git log-graph](doc/git-log-graph/index.md) - + * [git log-like-long](doc/git-log-like-long/index.md) - + * [git log-like](doc/git-log-like/index.md) - + * [git log-my](doc/git-log-my/index.md) - Show log with my own commits by my own user email + * [git log-my-day](doc/git-log-my-day/index.md) - Show log with my own recent day + * [git log-my-hour](doc/git-log-my-hour/index.md) - Show log with my own recent hour + * [git log-my-month](doc/git-log-my-month/index.md) - Show log with my own recent month + * [git log-my-week](doc/git-log-my-week/index.md) - Show log with my own recent week + * [git log-my-year](doc/git-log-my-year/index.md) - Show log with my own recent year + * [git log-of-count-and-day](doc/git-log-of-count-and-day/index.md) - Show log with count and day + * [git log-of-count-and-day-of-week](doc/git-log-of-count-and-day-of-week/index.md) - Show log with count and day of week + * [git log-of-count-and-email](doc/git-log-of-count-and-email/index.md) - Show log with count and email + * [git log-of-count-and-format](doc/git-log-of-count-and-format/index.md) - Show log with count and custom format string + * [git log-of-count-and-format-with-date](doc/git-log-of-count-and-format-with-date/index.md) - Show log with count and custom format string and date + * [git log-of-count-and-hour](doc/git-log-of-count-and-hour/index.md) - Show log with count and hour + * [git log-of-count-and-hour-of-day](doc/git-log-of-count-and-hour-of-day/index.md) - Show log with count and hour of day + * [git log-of-count-and-month](doc/git-log-of-count-and-month/index.md) - Show log with count and month + * [git log-of-count-and-week](doc/git-log-of-count-and-week/index.md) - Show log with count and week + * [git log-of-count-and-week-of-year](doc/git-log-of-count-and-week-of-year/index.md) - Show log with count and week of year + * [git log-of-count-and-year](doc/git-log-of-count-and-year/index.md) - Show log with count and year + * [git log-of-day-and-count](doc/git-log-of-day-and-count/index.md) - Show log with day and count + * [git log-of-day-of-week-and-count](doc/git-log-of-day-of-week-and-count/index.md) - Show log with week and count + * [git log-of-email-and-count](doc/git-log-of-email-and-count/index.md) - Show log with email and count + * [git log-of-format-and-count](doc/git-log-of-format-and-count/index.md) - Show a specific format string and count of log entries + * [git log-of-format-and-count-with-date](doc/git-log-of-format-and-count-with-date/index.md) - Show log with custom format string and count with date + * [git log-of-hour-and-count](doc/git-log-of-hour-and-count/index.md) - Show log with hour and count + * [git log-of-hour-of-day-and-count](doc/git-log-of-hour-of-day-and-count/index.md) - Show log with hour of day and count + * [git log-of-month-and-count](doc/git-log-of-month-and-count/index.md) - Show log with month and count + * [git log-of-week-and-count](doc/git-log-of-week-and-count/index.md) - Show log with week and count + * [git log-of-week-of-year-and-count](doc/git-log-of-week-of-year-and-count/index.md) - Show log with week of year and count + * [git log-of-year-and-count](doc/git-log-of-year-and-count/index.md) - Show log with year and count + * [git log-refs](doc/git-log-refs/index.md) - Show log with commits that are referred by some branch or tag + * [git log-timeline](doc/git-log-timeline/index.md) - + * [git lp](doc/git-lp/index.md) - Log with patch generation + * [git ls](doc/git-ls/index.md) - List files in the index and the working tree; like Unix "ls" command + * [git lsd](doc/git-lsd/index.md) - List files and show debug information + * [git lsfn](doc/git-lsfn/index.md) - List files and show full name + * [git lsio](doc/git-lsio/index.md) - List files that git is ignoring + * [git lto](doc/git-lto/index.md) - Log with items appearing in topological order + * [git m](doc/git-m/index.md) - Short for "git merge" + * [git ma](doc/git-ma/index.md) - Merge abort i.e. abort the merge process + * [git mainly](doc/git-mainly/index.md) - Make local like main + * [git mc](doc/git-mc/index.md) - Merge continue i.e. continue the merge process + * [git mncnf](doc/git-mncnf/index.md) - Merge with no autocommit, and with no fast-forward + * [git merge-span](doc/git-merge-span/index.md) - Merge span aliases + * [git merge-span-diff](doc/git-merge-span-diff/index.md) - Show the changes that were introduced by a merge + * [git merge-span-difftool](doc/git-merge-span-difftool/index.md) - Show the changes that were introduced by a merge, in your difftool + * [git merge-span-log](doc/git-merge-span-log/index.md) - Find the commits that were introduced by a merge + * [git move-alias](doc/git-move-alias/index.md) - Rename an existing git alias + * [git o](doc/git-o/index.md) - Short for "git checkout" + * [git optimizer](doc/git-optimizer/index.md) - Optimize the repository by pruning and repacking + * [git orphans](doc/git-orphans/index.md) - Find all objects that aren't referenced by any other object + * [git ours](doc/git-ours/index.md) - Checkout our version of a file and add it + * [git outbound](doc/git-outbound/index.md) - Show outgoing changes compared to upstream + * [git p](doc/git-p/index.md) - Short for "git pull" + * [git panic](doc/git-panic/index.md) - When you're a little worried that the world is coming to an end + * [git pf](doc/git-pf/index.md) - Pull if a merge can be resolved as a fast-forward, otherwise fail + * [git pp](doc/git-pp/index.md) - Pull with rebase preserve of merge commits + * [git pr](doc/git-pr/index.md) - Pull with rebase i.e. provide a cleaner, linear, bisectable history + * [git pruner](doc/git-pruner/index.md) - Prune everything that is unreachable now + * [git publish](doc/git-publish/index.md) - Publish the current branch + * [git pull1](doc/git-pull1/index.md) - Pull just the one current branch + * [git push1](doc/git-push1/index.md) - Push just the one current branch + * [git pushy](doc/git-pushy/index.md) - Push with force and lease + * [git put](doc/git-put/index.md) - Put all changes for the current branch + * [git rb](doc/git-rb/index.md) - Short for "git rebase" + * [git rba](doc/git-rba/index.md) - Rebase abort i.e. abort the rebase process + * [git rbc](doc/git-rbc/index.md) - Rebase continue i.e. continue the rebase process + * [git rbi](doc/git-rbi/index.md) - Rebase interactive i.e. do a rebase with prompts + * [git rbiu](doc/git-rbiu/index.md) - Rebase interactive on unpushed commits + * [git rbs](doc/git-rbs/index.md) - Rebase skip i.e. restart the rebase process by skipping the current patch + * [git rebase-branch](doc/git-rebase-branch/index.md) - Interactively rebase all the commits on the current branch + * [git rebase-recent](doc/git-rebase-recent/index.md) - Rebase recent commits with interactive + * [git ref-recent](doc/git-ref-recent/index.md) - + * [git refs-by-date](doc/git-refs-by-date/index.md) - Show refs sorted by date for branches + * [git reincarnate](doc/git-reincarnate/index.md) - Delete a branch then create it anew + * [git remote-ref](doc/git-remote-ref/index.md) - TODO + * [git remotes-prune](doc/git-remotes-prune/index.md) - For each remote branch, prune it + * [git remotes-push](doc/git-remotes-push/index.md) - For each remote branch, push it + * [git repacker](doc/git-repacker/index.md) - Repack a repo as recommended by Linus + * [git reset-commit](doc/git-reset-commit/index.md) - Reset a commit with a soft reset + * [git reset-commit-hard](doc/git-reset-commit-hard/index.md) - Reset a commit with a hard reset + * [git reset-commit-hard-clean](doc/git-reset-commit-hard-clean/index.md) - Reset a commit with a hard reset and a clean + * [git reset-to-pristine](doc/git-reset-to-pristine/index.md) - Reset commits and clean all differences + * [git reset-to-upstream](doc/git-reset-to-upstream/index.md) - Reset commits back to the upstream branch + * [git rev-list-all-objects-by-size-and-name](doc/git-rev-list-all-objects-by-size-and-name/index.md) - List all objects by size in bytes and file name + * [git rev-list-all-objects-by-size](doc/git-rev-list-all-objects-by-size/index.md) - List all blobs by size in bytes + * [git rl](doc/git-rl/index.md) - Short for "git reflog" + * [git rr](doc/git-rr/index.md) - Short for "git remote" + * [git rrp](doc/git-rrp/index.md) - Remote prune i.e. delete all stale remote-tracking branches under + * [git rrs](doc/git-rrs/index.md) - Remote show i.e. give information about the remote + * [git rru](doc/git-rru/index.md) - remote update i.e. fetch updates for a named set of remotes in the repository as defined by remotes + * [git rv](doc/git-rv/index.md) - Short for "git revert" + * [git rvnc](doc/git-rvnc/index.md) - Revert with no commit i.e. without autocommit + * [git s](doc/git-s/index.md) - Short for "git status" + * [git sb](doc/git-sb/index.md) - Short for "git show-branch" i.e. print a list of branches and their commits + * [git search-commits](doc/git-search-commits/index.md) - Search for a given string in all patches and print commit messages + * [git serve](doc/git-serve/index.md) - Serve the local directory by starting a git server daemon + * [git show-unreachable](doc/git-show-unreachable/index.md) - Show logs of unreachable commits + * [git sm](doc/git-sm/index.md) - Short for "git submodule" + * [git sma](doc/git-sma/index.md) - Submodule add i.e. add a submodule to this repo + * [git smi](doc/git-smi/index.md) - Submodule init i.e. initialize a submodule in this repo + * [git sms](doc/git-sms/index.md) - Submodule sync i.e. synchronize a submodule in this repo + * [git smu](doc/git-smu/index.md) - Submodule update i.e. update a submodule in this repo + * [git smui](doc/git-smui/index.md) - Submodule update with initialize + * [git smuir](doc/git-smuir/index.md) - Submodule update with initialize and recursive; this is useful to bring a submodule fully up to date + * [git snapshot](doc/git-snapshot/index.md) - Take a snapshot of your current working tree + * [git ss](doc/git-ss/index.md) - Status with short format + * [git ssb](doc/git-ssb/index.md) - Status with short format and branch info + * [git stashes](doc/git-stashes/index.md) - List stashes + * [git summary](doc/git-summary/index.md) - Show a helpful summary of some typical metrics + * [git svn-b](doc/git-svn-b/index.md) - Subversion branch + * [git svn-c](doc/git-svn-c/index.md) - Subversion commit + * [git svn-cp](doc/git-svn-cp/index.md) - Subversion cherry pick + * [git svn-m](doc/git-svn-m/index.md) - Subversion merge + * [git tags](doc/git-tags/index.md) - List tags + * [git theirs](doc/git-theirs/index.md) - Checkout their version of a file and add it + * [git top](doc/git-top/index.md) - Get the top level directory name + * [git topic-*](git-topic/index.md) - Read this first about topic aliases + * [git topic-base](doc/git-topic-base/index.md) - Show the project base topic branch name + * [git topic-move](doc/git-topic-move/index.md) - Rename the current topic branch + * [git topic-begin](doc/git-topic-begin/index.md) - Start a new topic branch + * [git topic-end](doc/git-topic-end/index.md) - Finish the current topic branch + * [git topic-sync](doc/git-topic-sync/index.md) - Synchronize the current topic branch by doing updates + * [git track-all-remote-branches](doc/git-track-all-remote-branches/index.md) - Track all remote branches that aren't already being tracked + * [git track](doc/git-track/index.md) - Start tracking a branch, with default parameters, and showing the command + * [git unadd](doc/git-unadd/index.md) - Reset something that's been added + * [git unassume-all](doc/git-unassume-all/index.md) - Unassume all files + * [git unassume](doc/git-unassume/index.md) - Unassume files + * [git uncommit](doc/git-uncommit/index.md) - Reset one commit + * [git undo-commit](doc/git-undo-commit/index.md) - Undo a commit with a soft reset + * [git undo-commit-hard](doc/git-undo-commit-hard/index.md) - Undo a commit with a hard reset + * [git undo-commit-hard-clean](doc/git-undo-commit-hard-clean/index.md) - Undo a commit with a hard reset and a clean + * [git undo-to-pristine](doc/git-undo-to-pristine/index.md) - Undo commits and clean all differences + * [git undo-to-upstream](doc/git-undo-to-upstream/index.md) - Undo commits back to the upstream branch + * [git unpublish](doc/git-unpublish/index.md) - Unpublish the current branch + * [git untrack](doc/git-untrack/index.md) - Stop tracking a branch, with default parameters, and showing the command + * [git unwip](doc/git-unwip/index.md) - Load "work in progress" + * [git upstream-branch](doc/git-upstream-branch/index.md) - Get the upstream branch name + * [git w](doc/git-w/index.md) - Short for "git whatchanged" + * [git whatis](doc/git-whatis/index.md) - Given a git object, try to show it briefly + * [git who](doc/git-who/index.md) - Show a short log of who has contributed commits, in descending order + * [git whois](doc/git-whois/index.md) - Given a string for an author, try to figure out full name and email + * [git wip](doc/git-wip/index.md) - Save "work in progress" + + +### Tracking + + * Package: gitalias + * Version: 27.0.0 + * Created: 2016-06-17T22:05:43Z + * Updated: 2022-01-09T19:00:32Z + * License: GPL-2.0-or-later or contact us for custom license + * Contact: Joel Parker Henderson (joel@joelparkerhenderson.com) diff --git a/doc/alias/TODO/index.md b/doc/alias/TODO/index.md deleted file mode 100644 index f795056f..00000000 --- a/doc/alias/TODO/index.md +++ /dev/null @@ -1,48 +0,0 @@ -# TODO - - # Latest annotated tag in all branches - lasttagged = !git describe --tags `git rev-list --tags --max-count=1` - - # From https://gist.github.com/492227 - heads = !"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';'" - - - ### REF ALIASES ### - - ref-recent = "!git for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) %(objectname:short) %(contents:subject)' refs/heads/" - - ### WORKFLOW ALIASES ### - - # Do everything we can to make the local repo like the main branch. - # - # TODO: handle tags, and delete superfluous branches, and add error handling. - # - mainly = !git checkout main && git fetch origin --prune && git reset --hard origin/main - - -? = !"f() { \ - branch=${1:-$(git config --global init.defaultBranch) - - 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" - - - # Ignore all untracked files by appending them to .gitignore: - ignore = "!git status | grep -P \"^\\t\" | grep -vF .gitignore | sed \"s/^\\t//\" >> .gitignore" - - # Discard changes in a (list of) file(s) in working tree - discard = checkout -- - - - # Thanks to jtolds on stackoverflow - remote-ref = !"sh -c ' \ - 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'" - - # Thanks to jtolds on stackoverflow - rebase-recent = !git rebase --interactive $(git remote-ref) diff --git a/doc/alias/git-aa/index.md b/doc/alias/git-aa/index.md deleted file mode 100644 index 90f516cf..00000000 --- a/doc/alias/git-aa/index.md +++ /dev/null @@ -1,14 +0,0 @@ -# git aa - -## Add all paths - -```gitconfig -aa = add --all -``` - -Example: - -```sh -$ git aa -``` - diff --git a/doc/alias/git-au/index.md b/doc/alias/git-au/index.md deleted file mode 100644 index 23bc1540..00000000 --- a/doc/alias/git-au/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git au - -## Add just the files that are updated - -```gitconfig -au = add --update -``` - -Example: - -```sh -$ git au -``` diff --git a/doc/alias/git-b/index.md b/doc/alias/git-b/index.md deleted file mode 100644 index bb351221..00000000 --- a/doc/alias/git-b/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git b - -## Shortcut for "branch" - -```gitconfig -b = branch -``` - -Example: - -```sh -$ git b -``` diff --git a/doc/alias/git-c/index.md b/doc/alias/git-c/index.md deleted file mode 100644 index f7809edd..00000000 --- a/doc/alias/git-c/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git c - -## Shortcut for "commit" - -```gitconfig -c = commit -``` - -Example: - -```sh -$ git c -``` diff --git a/doc/alias/git-ca/index.md b/doc/alias/git-ca/index.md deleted file mode 100644 index c5412253..00000000 --- a/doc/alias/git-ca/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git ca - -# Amend the tip of the current branch; do not create a new commit - -```gitconfig -ca = commit --amend -``` - -Example: - -```sh -$ git ca -``` diff --git a/doc/alias/git-cam/index.md b/doc/alias/git-cam/index.md deleted file mode 100644 index 2093a9aa..00000000 --- a/doc/alias/git-cam/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git cam - -## Amend the tip of the current branch; edit the message. - -```gitconfig -cam = commit --amend --message -``` - -Example: - -```sh -$ git cam -``` diff --git a/doc/alias/git-cleaner/index.md b/doc/alias/git-cleaner/index.md deleted file mode 100644 index b07ea3a9..00000000 --- a/doc/alias/git-cleaner/index.md +++ /dev/null @@ -1,50 +0,0 @@ -# git cleaner - -## Use git clean to make everything pristine - -```gitconfig -cleaner = clean -ffdx -`` - -Example: - -```sh -$ git cleaner -``` - -This will remove untracked files from the working tree. - -What the flags do: - -
- -
-d
- -
-Normally, when no is specified, git clean will not recurse into -untracked directories to avoid removing too much. Specify -d to have it recurse -into such directories as well. If any paths are specified, -d is irrelevant; -all untracked files matching the specified paths (with exceptions for nested -git directories mentioned under --force) will be removed. -
- -
-f, --force
- -
-If the Git configuration variable clean.requireForce is not set to false, git -clean will refuse to delete files or directories unless given -f or -i. Git -will refuse to modify untracked nested git repositories (directories with a -.git subdirectory) unless a second -f is given. -
- -
-x
- -
-Don't use the standard ignore rules (see gitignore(5)), but still use the -ignore rules given with -e options from the command line. This allows removing -all untracked files, including build products. This can be used (possibly in -conjunction with git restore or git reset) to create a pristine working -directory to test a clean build. -
- -
diff --git a/doc/alias/git-d/index.md b/doc/alias/git-d/index.md deleted file mode 100644 index 982b9e93..00000000 --- a/doc/alias/git-d/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git d - -## Shortcut for "diff" - -```gitalias -d = diff -``` - -Example: - -```sh -$ git d -``` diff --git a/doc/alias/git-f/index.md b/doc/alias/git-f/index.md deleted file mode 100644 index 860d092a..00000000 --- a/doc/alias/git-f/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git f - -## Shortcut for "fetch" - -```gitconfig -f = fetch -``` - -Example: - -```sh -$ git f -``` diff --git a/doc/alias/git-initer/index.md b/doc/alias/git-initer/index.md deleted file mode 100644 index 72e5a4d7..00000000 --- a/doc/alias/git-initer/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# git initer - -# Initalize a repo with an empty commit to help rebase - -```gitconfig -initer = !"f() { \ - git init && \ - git commit --allow-empty --allow-empty-message --message ''; \ -}; f" -``` - -Example: - -```sh -$ git initer -``` - -This tactic makes it easier to do subsequent git rebase commands. diff --git a/doc/alias/git-l/index.md b/doc/alias/git-l/index.md deleted file mode 100644 index f6aa4b68..00000000 --- a/doc/alias/git-l/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git l - -## Shortcut for "log" - -```gitalias -l = log -``` - -Example: - -```sh -$ git l -``` diff --git a/doc/alias/git-last-tag/index.md b/doc/alias/git-last-tag/index.md deleted file mode 100644 index d4e911bf..00000000 --- a/doc/alias/git-last-tag/index.md +++ /dev/null @@ -1,37 +0,0 @@ -# git last-tag - -## Show the last tag in the current branch - -```gitconfig -last-tag = describe --tags --abbrev=0 -``` - -Example: - -```sh -$ git last-tag -``` - - -### Documentation for `git describe` - -
- -
--tags
- -
-Instead of using only the annotated tags, use any tag found in -refs/tags namespace. This option enables matching a lightweight -(non-annotated) tag. -
- -
--abbrev=
- -
-Instead of using the default 7 hexadecimal digits as the -abbreviated object name, use digits, or as many digits -as needed to form a unique object name. An of 0 will -suppress long format, only showing the closest tag. -
- -
diff --git a/doc/alias/git-m/index.md b/doc/alias/git-m/index.md deleted file mode 100644 index 219e3b80..00000000 --- a/doc/alias/git-m/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git m - -## Shortcut for "merge" - -```gitconfig -m = merge -``` - -Example: - -```sh -$ git m -``` diff --git a/doc/alias/git-o/index.md b/doc/alias/git-o/index.md deleted file mode 100644 index 4075d55f..00000000 --- a/doc/alias/git-o/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git o - -## Shortcut for "checkout" - -```gitalias -o = checkout -``` - -Example: - -```sh -$ git o -``` diff --git a/doc/alias/git-p/index.md b/doc/alias/git-p/index.md deleted file mode 100644 index 0d821244..00000000 --- a/doc/alias/git-p/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git p - -## Shortcut for "pull" - -```gitalias -p = pull -``` - -Example: - -```sh -$ git p -``` diff --git a/doc/alias/git-publish-git-unpublish/index.md b/doc/alias/git-publish-git-unpublish/index.md deleted file mode 100644 index 67657d54..00000000 --- a/doc/alias/git-publish-git-unpublish/index.md +++ /dev/null @@ -1,21 +0,0 @@ -# git publish & git unpublish - -## Publish/unpublish the current branch - -```gitconfig -# git publish: publish the current branch by pushing it -# to the remote "origin", and setting the current branch -# to track the upstream branch. -publish = !"git push --set-upstream origin $(git current-branch)" - -# git unpublish: unpublish the current branch by deleting the -# remote version of the current branch. -unpublish = !"git push origin :$(git current-branch)" -``` - -Example: - -```sh -$ git publish -$ git unpublish -``` diff --git a/doc/alias/git-pull1/index.md b/doc/alias/git-pull1/index.md deleted file mode 100644 index f762e5f2..00000000 --- a/doc/alias/git-pull1/index.md +++ /dev/null @@ -1,15 +0,0 @@ -# git pull1 - -## Pull just the current branch - -```gitconfig -pull1 = "!git pull origin $(git current-branch)" -``` - -Example: - -```sh -$ git pull1 -``` - -Compare [git push1](../git-push1). diff --git a/doc/alias/git-push1/index.md b/doc/alias/git-push1/index.md deleted file mode 100644 index 40d0503c..00000000 --- a/doc/alias/git-push1/index.md +++ /dev/null @@ -1,15 +0,0 @@ -# git push1 - -## Push just the current branch - -```gitconfig -push1 = "!git push origin $(git current-branch)" -``` - -Example: - -```sh -$ git push1 -``` - -Compare [git pull1](../git-pull1). diff --git a/doc/alias/git-r/index.md b/doc/alias/git-r/index.md deleted file mode 100644 index 54c68926..00000000 --- a/doc/alias/git-r/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git r - -## Shortcut for "remote" - -```gitconfig -r = remote -``` - -Example: - -```sh -$ git r -``` diff --git a/doc/alias/git-rb/index.md b/doc/alias/git-rb/index.md deleted file mode 100644 index 01597527..00000000 --- a/doc/alias/git-rb/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git rb - -## Shortcut for "rebase" - -```gitconfig -rb = rebase -``` - -Example: - -```sh -$ git rb -``` diff --git a/doc/alias/git-rr/index.md b/doc/alias/git-rr/index.md deleted file mode 100644 index 139c66e1..00000000 --- a/doc/alias/git-rr/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git rr - -## Shortcut for "remote" - -```gitconfig -rr = remote -``` - -Example: - -```sh -$ git rr -``` diff --git a/doc/alias/git-s/index.md b/doc/alias/git-s/index.md deleted file mode 100644 index 062a4146..00000000 --- a/doc/alias/git-s/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git s - -## Shortcut for "status" - -```gitconfig -s = status -``` - -Example: - -```sh -$ git s -``` diff --git a/doc/alias/git-sb/index.md b/doc/alias/git-sb/index.md deleted file mode 100644 index 729d116f..00000000 --- a/doc/alias/git-sb/index.md +++ /dev/null @@ -1,13 +0,0 @@ -# git sb - -## Shortcut for "show-branch" i.e. print a list of branches and their commits - -```gitconfig -sb = show-branch -``` - -Example: - -```sh -$ git sb -``` diff --git a/doc/alias/index.md b/doc/alias/index.md deleted file mode 100644 index e2ded30a..00000000 --- a/doc/alias/index.md +++ /dev/null @@ -1,350 +0,0 @@ -# Git Alias - -This project provides many git alias commands that you can use as you like. - -* [Introduction](introduction.md) -* [Install](install.md) -* [Examples](examples.md) -* [Customize](customize.md) - - -## One letter aliases - -One letter aliases are for our most-frequent commands: - -* [git a](git-a.md) = add -* [git b](git-b.md) = branch -* [git c](git-c.md) = commit -* [git d](git-d.md) = diff -* [git f](git-f.md) = fetch -* [git g](git-g.md) = grep -* [git l](git-l.md) = log -* [git m](git-m.md) = merge -* [git o](git-o.md) = checkout -* [git p](git-p.md) = pull -* [git s](git-s.md) = status -* [git w](git-w.md) = whatchanged - -One-letter aliases never use options, because we want -the aliases to be easy to compose and to be flexible. - - -## Short aliases for frequent commands - -Short aliases are for our very-frequent commands: - -git add: - -* [git a](git-a.md) = add -* [git aa](git-aa.md) = add --all -* [git ap](git-ap.md) = add --patch -* [git au](git-au.md) = add --update - -git branch: - -* [git b](git-bm.md) = branch -* [git bm](git-bm.md) = branch --merged -* [git bnm](git-bm.md) = branch --no-merged -* [git bed](git-bed.md) = branch --edit-description -* [git bsd](git-bsd.md) = branch --show-description (wishlist) - -git commit: - -* [git c](git-ca.md) = commit -* [git ca](git-ca.md) = commit --amend -* [git cam](git-cam.md) = commit --amend --message -* [git cane](git-cane.md) = commit --amend --no-edit -* [git ci](git-ci.md) = commit --interactive -* [git cm](git-ci.md) = commit --message - -git checkout: - -* [git co](git-co.md) = checkout -* [git cog](git-cog.md) = checkout --guess -* [git cong](git-cong.md) = checkout --no-guess - -git cherry-pick: - -* [git cp](git-cp.md) = cherry-pick -* [git cpa](git-cpa.md) = cherry-pick --abort -* [git cpc](git-cpc.md) = cherry-pick --continue -* [git cpn](git-cpn.md) = cherry-pick -n (--no-commit) -* [git cpnx](git-cpnx.md) = cherry-pick -n -x (--no-commit and with a message) - -git diff: - -* [git d](git-d.md) = diff -* [git dd](git-dd.md) = diff with our preferred settings -* [git dc](git-dc.md) = diff --cached -* [git ds](git-ds.md) = diff --staged -* [git dwd](git-ds.md) = diff --word-diff - -git grep: - -* [git g](git-g.md) = grep -* [git gg](git-gg.md) = grep with our preferred settings -* [git gn](git-gn.md) = grep -n (--line-number) - -git log: - -* [git l](git-l.md) = log -* [git ll](git-ll.md) = log with our preferred short settings -* [git lll](git-lll.md) = log with our preferred long settings -* [git lg](git-lg.md) = log --graph -* [git lo](git-lo.md) = log --oneline -* [git lp](git-lp.md) = log --patch -* [git lfp](git-lfp.md) = log --first-parent -* [git lto](git-lto.md) = log --topo-order - -git ls-files: - -* [git ls](git-ls.md) = ls-files -* [git lsd](git-lsd.md) = ls-files --debug -* [git lsfn](git-lsfn.md) = ls-files --full-name -* [git lsio](git-lsio.md) = ls-files --ignored --others --exclude-standard - -git merge: - -* [git m](git-m.md) = merge -* [git ma](git-ma.md) = merge --abort -* [git mc](git-mc.md) = merge --continue -* [git me](git-me.md) = merge --no-commit --no-ff - -git pull: - -* [git pf](git-pf.md) - git pull with fast-forward only -* [git pr](git-pr.md) - git pull with rebase -* [git pp](git-pp.md) - git pull with rebase preserve of merge commits - -git rebase: - -* [git rb](git-rb.md) = rebase -* [git rba](git-rb.md) = rebase --abort -* [git rbc](git-rbc.md) = rebase --continue -* [git rbs](git-rbs.md) = rebase --skip -* [git rbi](git-rbi.md) = rebase --interactive -* [git rbiu](git-rbiu.md) = rebase --interactive @{upstream} - -git reflog: - -* [git rl](git-rl.md) = reflog - -git remote: - -* [git rr](git-rr.md) = remote -* [git rrs](git-rrs.md) = remote show -* [git rru](git-rru.md) = remote update -* [git rrp](git-rrp.md) = remote prune - -git revert: - -* [git rv](git-rv.md) = revert -* [git rvnc](git-rvnc.md) = revert --no-commit - -git show-branch: - -* [git sb](git-sb.md) = show-branch -* [git sbdo](git-sbdo.md) = show-branch --date-order -* [git sbto](git-sbto.md) = show-branch --topo-order - -git submodule: - -* [git sm](git-sm.md) = submodule -* [git smi](git-smi.md) = submodule init -* [git sma](git-sma.md) = submodule add -* [git sms](git-sms.md) = submodule sync -* [git smu](git-smu.md) = submodule update -* [git smui](git-smui.md) = submodule update --init -* [git smuir](git-smuir.md) = submodule update --init --recursive - -git status: - -* [git s](git-s.md) = status -* [git ss](git-ss.md) = status --short -* [git ssb](git-ssb.md) = status --short --branch - - -## Friendly aliases - -Start: - -* [git initer](git-initer.md) - Initialize a repo with an empty rebaseable commit. -* [git cloner](git-cloner.md) - Clone a repo and recurse on any of its submodules. - -Branch names: - -* [git default-branch](git-default-branch.md) - Get the default branch name. -* [git current-branch](git-current-branch.md) - Get the current branch name. -* [git upstream-branch](git-upstream-branch.md) - Get the upstream branch name. -* [git topic-branch](git-topic-branch.md) - Get the topic branch name. - -List items: - -* [git aliases](git-aliases.md) - List aliases. -* [git branches](git-branches.md) - List branches. -* [git tags](git-tags.md) - List tags. -* [git stashes](git-stashes.md) - List stashes. - -Undo: - -* [git uncommit](git-uncommit.md) = reset --soft HEAD~1 -* [git unadd](git-unadd.md) = reset HEAD - - -## Convenience alaises - -Logging & reporting: - -* [git log](git-log.md) -* [git who](git-who.md) -* [git chart](git-chart.md) -* [git churn](git-churn.md) -* [git summary](git-summary.md) - -Lookups: - -* [git whois](git-whois.md) - Try to figure out an author's information. -* [git whatis](git-whatis.md) - Try to figure out an object's information. - -Commit details: - -* [git commit-parents](git-commit-parents.md) - Show the commit's parents. -* [git commit-is-merge](git-commit-is-merge.md) - Is the commit a merge commit? -* [git commit-message-key-lines](git-commit-message-key-lines.md) - -Add all & edit all: - -* [git add-*](git-edit.md) - Add all files of a given type. -* [git edit-*](git-edit.md) - Edit all files of a given type. - -Alias helpers: - -* [git add-alias](git-add-alias.md) - Create a new git alias. -* [git move-alias](git-move-alias.md) - Rename an existing git alias. - -Script helpers: - -* [git top-name](git-top-name.md) - Get the top level directory name. -* [git exec](git-exec.md) - Execute a shell script. - -Remotes: - -* [git remotes-prune](git-remotes-prune.md) - For each remote branch, prune it. -* [git remotes-push](git-remotes-push.md) - For each remote branch, push it. - -Misc: - -* [git diff-*](git-diff.md) -* [git grep-*](git-grep.md) -* [git merge-span-*](git-merge-span.md) -* [git orphans](git-orphans.md) -* [git fixup](git-fixup.md) -* [git rev-list-all-objects-by-size](git-rev-list-all-objects-by-size.md) -* [git rev-list-all-objects-by-size-and-name](git-rev-list-all-objects-by-size-and-name.md) -* [git cherry-pick-merge](git-cherry-pick-merge.md) -* [git refs-by-date](git-refs-by-date.md) - Sort by date for branches. - -Advanced aliases: - -* [git search-commits](git-search-commits.md) -* [git debug](git-debug.md) -* [git intercommit](git-intercommit.md) - - -## Workflow aliases - -Starting: - -* [git clone-lean](git-clone-lean.md) - -Save: - -* [git archive](git-archive.md) - Create an archive file of everything in the repo. -* [git snapshot](git-snapshot.md) - Stash a snapshot of your current working tree. -* [git panic](git-panic.md) - When you're worried the world is coming to an end. - -Flow aliases: - -* [git get & git put](git-get-git-put.md) -* [git ours & git theirs](git-ours-git-theirs.md) -* [git wip & git unwip](git-wip-git-unwip.md) -* [git assume & git unassume](git-assume-git-unassume.md) -* [git publish & git unpublish](git-publish-git-unpublish.md) - -reset & undo: - -* [git reset-*](git-reset.md) - Move backwards on the commit chain. -* [git undo-*](git-undo.md) - Move backwards on the commit chain. - -track & untrack: - -* [git track](git-track.md) - Start tracking from a local branch to upstream branch. -* [git untrack](git-untrack.md) - Stop tracking from a local branch to upstream branch. - -inbound & outbound: - -* [git inbound](git-inbound.md) - Show incoming changes compared to upstream. -* [git outbound](git-outbound.md) - Show outgoing changes compared to upstream. - -pull1 & push1: - -* [git pull1](git-pull1.md) - Pull just the current branch. -* [git push1](git-push1.md) - Push just the current branch. - -Topic branches: - -* [git topic-*](git-topic.md) - Read this first about topic branches. -* [git topic-branch](git-topic-branch.md) - Show the topic branch name. -* [git topic-start](git-topic-start.md) - Begin a topic branch. -* [git topic-stop](git-topic-stop.md) - End a topic branch. -* [git topic-sync](git-topic-sync.md) - Update a topic branch. -* [git topic-move](git-topic-move.md) - Rename a topic branch. - -Cull: - -* [git cull](git-cull-local.md) - Delete all branches that are merged. -* [git cull-locals](git-cull-local.md) - Delete local branches that are merged. -* [git cull-remotes](git-cull-remote.md) - Delete remote branches that are merged. - -Maintenance tuning: - -* [git cleaner](git-cleaner.md) - Clean the recommend way. -* [git pruner](git-pruner.md) - Prune the recommened way. -* [git repacker](git-repacker.md) - Repack the recommended way. -* [git optimizer](git-optimizer.md) - Optimize the recommended way. - -Misc: - -* [git issues](git-issues.md) - Show issues that are described in commit messages. -* [git expunge](git-expunge.md) - Use filter-branch to delete a file everywhere. -* [git reincarnate](git-reincarnate.md) - Kill a branch then create it anew. -* [git diff-chunk](git-diff-chunk.md) - Do a diff of two chunks in revisions. -* [git last-tag](git-last-tag.md) - Show the last tag in the current branch. -* [git serve](git-serve.md) - Serve the local directory via git server daemon. -* [git track-all-remote-branches](git-track-all-remote-branches.md) - Track all remote branches. -# [git cleanout](git-cleanout.md) - Clean and discard changes and untracked files in working tree. - - -## Tooling aliases - -Use gitk: - -* [git gitk-conflict](git-gitk-conflict.md) - Use gitk to show conflicting merge. -* [git gitk-history-all](git-history-all.md) - Use gitk to show full history. - -Use other version control systems: - -* [git cvs-*](git-cvs.md) - Use CVS version control. -* [git svn-*](git-svn.md) - Use Subversion version control. - -Use graphviz: - -* [git graphviz](git-graphviz.md) - Use graphviz for display. - - -## Epilog - -* [More information](more.html) -* [Contributing](contributing.md) -* [To do list](todo.html) -* [Thanks](thanks.html) diff --git a/doc/assets/prism.css b/doc/assets/prism.css new file mode 100644 index 00000000..15f30faf --- /dev/null +++ b/doc/assets/prism.css @@ -0,0 +1,3 @@ +/* PrismJS 1.25.0 +https://prismjs.com/download.html#themes=prism&languages=bash+git */ +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} diff --git a/doc/assets/prism.js b/doc/assets/prism.js new file mode 100644 index 00000000..b9fd1e97 --- /dev/null +++ b/doc/assets/prism.js @@ -0,0 +1,5 @@ +/* PrismJS 1.25.0 +https://prismjs.com/download.html#themes=prism&languages=bash+git */ +var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(u){var t=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,n=0,e={},M={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof W?new W(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&").replace(/=l.reach);y+=m.value.length,m=m.next){var k=m.value;if(t.length>n.length)return;if(!(k instanceof W)){var x,b=1;if(h){if(!(x=z(p,y,n,f))||x.index>=n.length)break;var w=x.index,A=x.index+x[0].length,P=y;for(P+=m.value.length;P<=w;)m=m.next,P+=m.value.length;if(P-=m.value.length,y=P,m.value instanceof W)continue;for(var E=m;E!==t.tail&&(Pl.reach&&(l.reach=j);var C=m.prev;S&&(C=I(t,C,S),y+=S.length),q(t,C,b);var N=new W(o,g?M.tokenize(L,g):L,d,L);if(m=I(t,C,N),O&&I(t,m,O),1l.reach&&(l.reach=_.reach)}}}}}}(e,a,n,a.head,0),function(e){var n=[],t=e.head.next;for(;t!==e.tail;)n.push(t.value),t=t.next;return n}(a)},hooks:{all:{},add:function(e,n){var t=M.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=M.hooks.all[e];if(t&&t.length)for(var r,a=0;r=t[a++];)r(n)}},Token:W};function W(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=0|(r||"").length}function z(e,n,t,r){e.lastIndex=n;var a=e.exec(t);if(a&&r&&a[1]){var i=a[1].length;a.index+=i,a[0]=a[0].slice(i)}return a}function i(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function I(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function q(e,n,t){for(var r=n.next,a=0;a"+a.content+""},!u.document)return u.addEventListener&&(M.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,r=n.code,a=n.immediateClose;u.postMessage(M.highlight(r,M.languages[t],t)),a&&u.close()},!1)),M;var r=M.util.currentScript();function a(){M.manual||M.highlightAll()}if(r&&(M.filename=r.src,r.hasAttribute("data-manual")&&(M.manual=!0)),!M.manual){var l=document.readyState;"loading"===l||"interactive"===l&&r&&r.defer?document.addEventListener("DOMContentLoaded",a):window.requestAnimationFrame?window.requestAnimationFrame(a):window.setTimeout(a,16)}return M}(_self);"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); +!function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var s=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=a.variable[1].inside,i=0;i \"; \ @@ -23,7 +25,7 @@ add-alias = "!f() { \ Example: -```sh +```shell $ git add-alias --local myalias mycommand $ git add-alias --global myalias mycommand diff --git a/doc/git-add-cached/index.md b/doc/git-add-cached/index.md new file mode 100644 index 00000000..67194643 --- /dev/null +++ b/doc/git-add-cached/index.md @@ -0,0 +1,37 @@ +# git add-cached + +## Add cached files + +Git alias: + +```git +add-cached = !"f() { git ls-files --cached | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-cached +``` + +Compare: + +* [git add-cached](../git-add-cached) (this alias) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-deleted/index.md b/doc/git-add-deleted/index.md new file mode 100644 index 00000000..e052f61b --- /dev/null +++ b/doc/git-add-deleted/index.md @@ -0,0 +1,37 @@ +# git add-deleted + +## Add deleted files + +Git alias: + +```git +add-deleted = !"f() { git ls-files --deleted | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-deleted +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) (this alias) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-ignored/index.md b/doc/git-add-ignored/index.md new file mode 100644 index 00000000..9a7283b9 --- /dev/null +++ b/doc/git-add-ignored/index.md @@ -0,0 +1,37 @@ +# git add-ignored + +## Add ignored files + +Git alias: + +```git +add-ignored = !"f() { git ls-files --ignored | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-ignored +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) (this alias) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-killed/index.md b/doc/git-add-killed/index.md new file mode 100644 index 00000000..cf852ce4 --- /dev/null +++ b/doc/git-add-killed/index.md @@ -0,0 +1,37 @@ +# git add-killed + +## Add killed files + +Git alias: + +```git +add-killed = !"f() { git ls-files --killed | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-killed +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) (this alias) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-modified/index.md b/doc/git-add-modified/index.md new file mode 100644 index 00000000..ea6db18c --- /dev/null +++ b/doc/git-add-modified/index.md @@ -0,0 +1,37 @@ +# git add-modified + +## Add modified files + +Git alias: + +```git +add-modified = !"f() { git ls-files --modified | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-modified +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) (this alias) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-others/index.md b/doc/git-add-others/index.md new file mode 100644 index 00000000..4947715a --- /dev/null +++ b/doc/git-add-others/index.md @@ -0,0 +1,37 @@ +# git add-others + +## Add other files + +Git alias: + +```git +add-others = !"f() { git ls-files --others | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-others +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) (this alias) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-stage/index.md b/doc/git-add-stage/index.md new file mode 100644 index 00000000..22a266f5 --- /dev/null +++ b/doc/git-add-stage/index.md @@ -0,0 +1,37 @@ +# git add-stage + +## Add stage files + +Git alias: + +```git +add-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-stage +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) (this alias) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/git-add-unmerged/index.md b/doc/git-add-unmerged/index.md new file mode 100644 index 00000000..69f55344 --- /dev/null +++ b/doc/git-add-unmerged/index.md @@ -0,0 +1,37 @@ +# git add-unmerged + +## Add unmerged files + +Git alias: + +```git +add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`" +``` + +Example: + +```shell +$ git add-unmerged +``` + +Compare: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) (this alias) +* [git add-unmerged](../git-add-unmerged) + +Compare corresponding aliases for edit-*: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) diff --git a/doc/alias/git-add/index.md b/doc/git-add/index.md similarity index 78% rename from doc/alias/git-add/index.md rename to doc/git-add/index.md index 0b222f01..b0f79b6c 100644 --- a/doc/alias/git-add/index.md +++ b/doc/git-add/index.md @@ -1,8 +1,21 @@ -# git add-* +# git add -## Add all paths of the given type +## Aliases to add files -```gitconfig + +### Shortcuts + +* [git a](../git-a) = add +* [git aa](../git-aa) = add --all +* [git ap](../git-ap) = add --patch +* [git au](../git-au) = add --update + + +### Add all paths of the given type + +Git alias: + +```git add-cached = !"f() { git ls-files --cached | sort -u ; }; git add `f`" add-deleted = !"f() { git ls-files --deleted | sort -u ; }; git add `f`" add-others = !"f() { git ls-files --others | sort -u ; }; git add `f`" @@ -15,7 +28,7 @@ add-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add Example: -```sh +```shell $ git add-cached $ git add-deleted $ git add-others diff --git a/doc/alias/git-aliases/index.md b/doc/git-aliases/index.md similarity index 93% rename from doc/alias/git-aliases/index.md rename to doc/git-aliases/index.md index 7f0f55ce..f5215000 100644 --- a/doc/alias/git-aliases/index.md +++ b/doc/git-aliases/index.md @@ -2,13 +2,15 @@ ## List git aliases -```gitconfig +Git alias: + +```git aliases = "!git config --get-regexp '^alias\\.' | cut -c 7- | sed 's/ / = /'" ``` Example: -```sh +```shell $ git aliases ``` diff --git a/doc/alias/git-ap/index.md b/doc/git-ap/index.md similarity index 61% rename from doc/alias/git-ap/index.md rename to doc/git-ap/index.md index 72e28a5a..79e00ce5 100644 --- a/doc/alias/git-ap/index.md +++ b/doc/git-ap/index.md @@ -1,14 +1,16 @@ # git ap -## Add by patch +## Short for "git add --patch" - Add by patch -```gitconfig +Git alias: + +```git ap = add --patch ``` Example: -```sh +```shell $ git ap ``` diff --git a/doc/alias/git-archive/index.md b/doc/git-archive/index.md similarity index 92% rename from doc/alias/git-archive/index.md rename to doc/git-archive/index.md index e335226c..d4331438 100644 --- a/doc/alias/git-archive/index.md +++ b/doc/git-archive/index.md @@ -2,7 +2,9 @@ ## Create an archive file of everything in the repo -```gitconfig +Git alias: + +```git archive = !"f() { \ top=$(rev-parse --show-toplevel); \ cd $top; \ @@ -12,7 +14,7 @@ archive = !"f() { \ Example: -```sh +```shell $ git archive ``` diff --git a/doc/git-assume-all/index.md b/doc/git-assume-all/index.md new file mode 100644 index 00000000..c5120139 --- /dev/null +++ b/doc/git-assume-all/index.md @@ -0,0 +1,17 @@ +# git assume-all + +## Assume all files are unchanged + +Git alias: + +```git +assume-all = "!git st -s | awk {'print $2'} | xargs git assume" +``` + +Example: + +```shell +$ git assume-all +``` + +To see how this works, see [git assume-* & git unassume-*](../git-assume-and-git-unassume) diff --git a/doc/alias/git-assume-git-unassume/index.md b/doc/git-assume-and-git-unassume/index.md similarity index 95% rename from doc/alias/git-assume-git-unassume/index.md rename to doc/git-assume-and-git-unassume/index.md index 4b51aa0d..ed709fd9 100644 --- a/doc/alias/git-assume-git-unassume/index.md +++ b/doc/git-assume-and-git-unassume/index.md @@ -1,8 +1,10 @@ -# git assume-* & git unassume +# git assume-* & git unassume-* ## Use update-index and assume-unchanged to skip commits -```gitconfig +Git alias: + +```git assume = update-index --assume-unchanged assume-all = "!git st -s | awk {'print $2'} | xargs git assume" assumed = !"git ls-files -v | grep ^h | cut -c 3-" @@ -25,7 +27,7 @@ and also be sure that we never check it in. Example: -```sh +```shell $ git status modified passwords.txt modified foo.txt diff --git a/doc/git-assume/index.md b/doc/git-assume/index.md new file mode 100644 index 00000000..05471f20 --- /dev/null +++ b/doc/git-assume/index.md @@ -0,0 +1,17 @@ +# git assume + +## Assume files are unchanged + +Git alias: + +```git +assume = update-index --assume-unchanged +``` + +Example: + +```shell +$ git assume +``` + +To see how this works, see [git assume-* & git unassume-*](../git-assume-and-git-unassume) diff --git a/doc/git-assumed/index.md b/doc/git-assumed/index.md new file mode 100644 index 00000000..9f159f79 --- /dev/null +++ b/doc/git-assumed/index.md @@ -0,0 +1,17 @@ +# git assumed + +## Show which files are assumed + +Git alias: + +```git +assumed = !"git ls-files -v | grep ^h | cut -c 3-" +``` + +Example: + +```shell +$ git assumed +``` + +To see how this works, see [git assume-* & git unassume-*](../git-assume-and-git-unassume) diff --git a/doc/git-au/index.html b/doc/git-au/index.html new file mode 100644 index 00000000..73d4ce28 --- /dev/null +++ b/doc/git-au/index.html @@ -0,0 +1,55 @@ + + + + + + git au - GitAlias + + + + + + + + +
+

git au

+

Short for “add –update”

+

Add just the files that are updated.

+

Git alias:

+
au = add --update
+
+

Example:

+
$ git au
+
+

Documentation

+
+
-u, --update
+
+

Update the index just where it already has an entry matching <pathspec>. This removes as well as modifies index entries to match the working tree, but adds no new files.

+

If no <pathspec> is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current +directory and its subdirectories).

+
+ +
+ + + + + diff --git a/doc/git-au/index.md b/doc/git-au/index.md new file mode 100644 index 00000000..405cf4b1 --- /dev/null +++ b/doc/git-au/index.md @@ -0,0 +1,35 @@ +# git au + +## Short for "git add --update" + +Add just the files that are updated. + +Git alias: + +```git +au = add --update +``` + +Example: + +```shell +$ git au +``` + + +### Documentation + +
+ +
-u, --update
+ +
+ +Update the index just where it already has an entry matching <pathspec>. This removes as well as modifies index entries to match the working tree, but adds no new files. + +If no <pathspec> is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current +directory and its subdirectories). + +
+ + diff --git a/doc/git-b/index.md b/doc/git-b/index.md new file mode 100644 index 00000000..07fea114 --- /dev/null +++ b/doc/git-b/index.md @@ -0,0 +1,15 @@ +# git b + +## Short for "git branch" + +Git alias: + +```git +b = branch +``` + +Example: + +```shell +$ git b +``` diff --git a/doc/alias/git-bed/index.md b/doc/git-bed/index.md similarity index 86% rename from doc/alias/git-bed/index.md rename to doc/git-bed/index.md index a911394e..7f5b2bdd 100644 --- a/doc/alias/git-bed/index.md +++ b/doc/git-bed/index.md @@ -2,13 +2,15 @@ ## Edit the description of a branch -```gitconfig +Git alias: + +```git bed = branch --edit-description ``` Example: -```sh +```shell $ git bed ``` diff --git a/doc/alias/git-bm/index.md b/doc/git-bm/index.md similarity index 68% rename from doc/alias/git-bm/index.md rename to doc/git-bm/index.md index cfe269ec..2112f6d2 100644 --- a/doc/alias/git-bm/index.md +++ b/doc/git-bm/index.md @@ -1,7 +1,9 @@ # git bm -## List branches whose tips are reachable from the specified commit (HEAD if not specified). +## List branches whose tips are reachable from the specified commit (HEAD if not specified) -```gitconfig +Git alias: + +```git bm = branch --merged ``` diff --git a/doc/alias/git-bnm/index.md b/doc/git-bnm/index.md similarity index 58% rename from doc/alias/git-bnm/index.md rename to doc/git-bnm/index.md index 512c6112..bb6bb3de 100644 --- a/doc/alias/git-bnm/index.md +++ b/doc/git-bnm/index.md @@ -1,9 +1,11 @@ # git bnm -## List branches whose tips are not reachable from the specified commit (HEAD if not specified). +## List branches whose tips are not reachable from the specified commit (HEAD if not specified) -```gitconfig +Git alias: + +```git bnm = branch --no-merged ``` -Compare [bm](git-bm) +Compare [bm](../git-bm) diff --git a/doc/git-branch-commit-first/index.md b/doc/git-branch-commit-first/index.md new file mode 100644 index 00000000..3a490af9 --- /dev/null +++ b/doc/git-branch-commit-first/index.md @@ -0,0 +1,52 @@ +# git branch-commit-first + +## Show a branch's first commit hash (or hashes) + +Git alias: + +```git +branch-commit-first = "!f() { \ + branch="${1:-$(git my-branch)}"; \ + count="${2:-1}"; \ + git log --reverse --pretty=%H "$branch" | \ + head -"$count"; \ +}; f" +``` + +Syntax: + +```shell +$ git branch-commit-first [branch name [commit count]] +``` + +Options: + + * branch name: default is the current branch name. + + * commit count: default is 1 + +Example: show the current branch's first commit hash: + +```shell +$ git branch-commit-first +``` + +Example: show the "foo" branch's first commit hash: + +```shell +$ git branch-commit-first foo +``` + +Example: show the "foo" branch's first 3 commit hashes: + +```shell +$ git branch-commit-first foo 3 +``` + +Compare: + +* [git branch-commit-first](../git-branch-commit-first): show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last): show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev): show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next): show a branch's next commit hash (or hashes) + diff --git a/doc/git-branch-commit-last/index.md b/doc/git-branch-commit-last/index.md new file mode 100644 index 00000000..af03d055 --- /dev/null +++ b/doc/git-branch-commit-last/index.md @@ -0,0 +1,51 @@ +# git branch-commit-last + +## Show a branch's last commit hash (or hashes) + +Git alias: + +```git +branch-commit-last = "!f() { \ + branch="${1:-$(git my-branch)}"; \ + count="${2:-1}"; \ + git log --pretty=%H "$branch" | \ + head -"$count"; \ +}; f" +``` + +Syntax: + +```shell +$ git branch-commit-last [branch name [commit count]] +``` + +Options: + + * branch name: default is the current branch name. + + * commit count: default is 1 + +Example: show the current branch's last commit hash: + +```shell +git branch-commit-last +``` + +Example: show the "foo" branch's last commit hash: + +```shell +$ git branch-commit-last foo +``` + +Example: show the "foo" branch's last 3 commit hashes: + +```shell +git branch-commit-last foo 3 +``` + +Compare: + +* [git branch-commit-first](../git-branch-commit-first): show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last): show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev): show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next): show a branch's next commit hash (or hashes) diff --git a/doc/git-branch-commit-next/index.md b/doc/git-branch-commit-next/index.md new file mode 100644 index 00000000..d48ed7ec --- /dev/null +++ b/doc/git-branch-commit-next/index.md @@ -0,0 +1,55 @@ +# git branch-commit-next + +## Show a branch's next commit hash (or hashes) + +Git alias: + +```git +branch-commit-next = "!f() { \ + branch="${1:-$(git my-branch)}"; \ + count="${2:-1}"; \ + git log --reverse --pretty=%H "$branch" | \ + grep -A "$count" $(git rev-parse HEAD) | \ + tail +2; \ +}; f" +``` + +Syntax: + +```shell +git branch-commit-next [branch name [commit count]] +``` + +Options: + + * branch name: default is the current branch name. + + * commit count: default is 1 + +Example: show the current branch's next commit hash: + +```shell +$ git branch-commit-next +``` + +Example: show the "foo" branch's next commit hash: + +```shell +$ git branch-commit-next next +``` + +Example: show the "foo" branch's next 3 commit hashes: + +```shell +$ git branch-commit-next foo 3 +``` + +Compare: + +* [git branch-commit-first]() +Compare: + +* [git branch-commit-first](../git-branch-commit-first): show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last): show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev): show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next): show a branch's next commit hash (or hashes) diff --git a/doc/git-branch-commit-prev/index.md b/doc/git-branch-commit-prev/index.md new file mode 100644 index 00000000..ba6b64c4 --- /dev/null +++ b/doc/git-branch-commit-prev/index.md @@ -0,0 +1,52 @@ +# git branch-commit-prev + +## Show a branch's previous commit hash (or hashes) + +Git alias: + +```git +branch-commit-prev = "!f() { \ + branch="${1:-$(git my-branch)}"; \ + count="${2:-1}"; \ + git log --pretty=%H "$branch" | \ + grep -A "$count" $(git rev-parse HEAD) | \ + tail +2; \ +}; f" +``` + +Syntax: + +```shell +$ git branch-commit-prev [branch name [commit count]] +``` + +Options: + + * branch name: default is the current branch name. + + * commit count: default is 1 + +Example: show the current branch's previous commit hash: + +```shell +$ git branch-commit-prev +``` + +Example: show the "foo" branch's previous commit hash: + +```shell +$ git branch-commit-prev previous +``` + +Example: show the "foo" branch's previous 3 commit hashes: + +```shell +$ git branch-commit-prev foo 3 +``` + +Compare: + +* [git branch-commit-first](../git-branch-commit-first): show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last): show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev): show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next): show a branch's next commit hash (or hashes) diff --git a/doc/git-branch-commit/index.md b/doc/git-branch-commit/index.md new file mode 100644 index 00000000..3d10ea05 --- /dev/null +++ b/doc/git-branch-commit/index.md @@ -0,0 +1,15 @@ +# git-branch-commit-* + +## Show a branch's commit hash via ordering + +* [git branch-commit-first](../git-branch-commit-first): show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last): show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev): show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next): show a branch's next commit hash (or hashes) + +Inspirations: + + * Email from Demian proposing these aliases + + * https://github.com/hutusi/git-paging + \ No newline at end of file diff --git a/doc/alias/git-branch-name/index.md b/doc/git-branch-name/index.md similarity index 61% rename from doc/alias/git-branch-name/index.md rename to doc/git-branch-name/index.md index cfc77a11..23e73049 100644 --- a/doc/alias/git-branch-name/index.md +++ b/doc/git-branch-name/index.md @@ -1,14 +1,16 @@ -# git current-branch +# git my-branch ## Get the current branch name -```gitconfig +Git alias: + +```git branch-name = rev-parse --abbrev-ref HEAD ``` Example: -```sh -$ git current-branch +```shell +$ git my-branch main ``` diff --git a/doc/git-branch/index.md b/doc/git-branch/index.md new file mode 100644 index 00000000..9b80f7b2 --- /dev/null +++ b/doc/git-branch/index.md @@ -0,0 +1,38 @@ +# git branch + +## Aliases related to git branch + + +### Shortcuts + +* [git b](git-b) = branch +* [git bm](git-bm) = branch --merged +* [git bnm](git-bm) = branch --no-merged +* [git bed](git-bed) = branch --edit-description +* [git bsd](git-bsd) = branch --show-description (wishlist) + + +### Branch names + +* [git default-branch](git-default-branch) - Get the default branch name. +* [git my-branch](git-my-branch) - Get the current branch name. +* [git upstream-branch](git-upstream-branch) - Get the upstream branch name. +* [git topic-base](git-topic-base) - Get the topic branch name. + + +### Branch commits + +* [git branch-commit-first](../git-branch-commit-first) - Show a branch's first commit hash (or hashes). +* [git branch-commit-last](../git-branch-commit-last) - Show a branch's last commit hash (or hashes). +* [git branch-commit-prev](../git-branch-commit-prev) - Show a branch's previous commit hash (or hashes). +* [git branch-commit-next](../git-branch-commit-next) - Show a branch's next commit hash (or hashes). + + +### Topic branches + +* [git topic-*](git-topic) - Read this first about topic branches. +* [git topic-base](git-topic-base) - Show the topic base branch name. +* [git topic-begin](git-topic-begin) - Start a new topic branch. +* [git topic-end](git-topic-end) - Finish the current topic branch. +* [git topic-sync](git-topic-sync) - Synchronize the current topic branch. +* [git topic-move](git-topic-move) - Rename the current topic branch. diff --git a/doc/alias/git-branches/index.md b/doc/git-branches/index.md similarity index 94% rename from doc/alias/git-branches/index.md rename to doc/git-branches/index.md index 971f7713..f0519394 100644 --- a/doc/alias/git-branches/index.md +++ b/doc/git-branches/index.md @@ -2,7 +2,9 @@ ## List branches -```gitconfig +Git alias: + +```git branches = branch -a ``` diff --git a/doc/alias/git-bsd/index.md b/doc/git-bsd/index.md similarity index 93% rename from doc/alias/git-bsd/index.md rename to doc/git-bsd/index.md index 0f4776c3..c8eaa3d8 100644 --- a/doc/alias/git-bsd/index.md +++ b/doc/git-bsd/index.md @@ -2,7 +2,9 @@ ## Show the description of a branch -```gitconfig +Git alias: + +```git bsd = "!f(){ \ branch=\"${1:-$(git rev-parse --abbrev-ref HEAD 2>/dev/null)}\"; \ git config \"branch.$branch.description\"; \ @@ -11,7 +13,7 @@ bsd = "!f(){ \ Example: -```sh +```shell $ git bsd This is an example branch ``` diff --git a/doc/git-bv/index.md b/doc/git-bv/index.md new file mode 100644 index 00000000..8f104e0f --- /dev/null +++ b/doc/git-bv/index.md @@ -0,0 +1,27 @@ +# git bv + +## List branch information with hash and subject + +Git alias: + +```git +bv = branch --verbose +``` + +Example: + +```shell +$ git bv +``` + +When in list mode, then show the hash, the commit subject line, etc. + +This is identical to doing `git b -v`. + +Compare these: + +* [git b](../git-b) + +* [git bv](../git-bv) (this alias) + +* [git bvv](../git-bvv) diff --git a/doc/git-bvv/index.md b/doc/git-bvv/index.md new file mode 100644 index 00000000..714c628c --- /dev/null +++ b/doc/git-bvv/index.md @@ -0,0 +1,27 @@ +# git bvv + +## List branch information with hash and subject and upstream + +Git alias: + +```git +bvv = branch --verbose --verbose +``` + +Example: + +```shell +$ git bvv +``` + +When in list mode, then show the hash, the commit subject line, the upstream branch, etc. + +This is identical to doing `git b -vv`. + +Compare: + +* [git b](../git-b) + +* [git bv](../git-bv) + +* [git bvv](../git-bvv) (this alias) diff --git a/doc/git-c/index.md b/doc/git-c/index.md new file mode 100644 index 00000000..ccb9007d --- /dev/null +++ b/doc/git-c/index.md @@ -0,0 +1,15 @@ +# git c + +## Short for "git commit" + +Git alias: + +```git +c = commit +``` + +Example: + +```shell +$ git c +``` diff --git a/doc/git-ca/index.md b/doc/git-ca/index.md new file mode 100644 index 00000000..ff01260f --- /dev/null +++ b/doc/git-ca/index.md @@ -0,0 +1,15 @@ +# git ca + +## Amend the tip of the current branch; do not create a new commit + +Git alias: + +```git +ca = commit --amend +``` + +Example: + +```shell +$ git ca +``` diff --git a/doc/git-cam/index.md b/doc/git-cam/index.md new file mode 100644 index 00000000..9ad4c862 --- /dev/null +++ b/doc/git-cam/index.md @@ -0,0 +1,15 @@ +# git cam + +## Amend the tip of the current branch; edit the message + +Git alias: + +```git +cam = commit --amend --message +``` + +Example: + +```shell +$ git cam +``` diff --git a/doc/alias/git-cane/index.md b/doc/git-cane/index.md similarity index 83% rename from doc/alias/git-cane/index.md rename to doc/git-cane/index.md index 1b187c93..6a884953 100644 --- a/doc/alias/git-cane/index.md +++ b/doc/git-cane/index.md @@ -2,12 +2,14 @@ ## Amend the tip of the current branch; do not edit the message -```gitconfig +Git alias: + +```git cane = commit --amend --no-edit ``` Example: -```sh +```shell $ git cane ``` diff --git a/doc/alias/git-chart/index.md b/doc/git-chart/index.md similarity index 98% rename from doc/alias/git-chart/index.md rename to doc/git-chart/index.md index d688e2f0..2565734b 100644 --- a/doc/alias/git-chart/index.md +++ b/doc/git-chart/index.md @@ -2,7 +2,9 @@ ## Show a summary chart of activity per author -```gitconfig +Git alias: + +```git chart = "!f() { \ git log \ --format=oneline \ @@ -51,7 +53,7 @@ chart = "!f() { \ Example: -```sh +```shell $ git chart ..X..........X...2..12 alice@example.com ....2..2..13.......... bob@example.com diff --git a/doc/alias/git-cherry-pick-merge/index.md b/doc/git-cherry-pick-merge/index.md similarity index 91% rename from doc/alias/git-cherry-pick-merge/index.md rename to doc/git-cherry-pick-merge/index.md index 9675d008..646892b2 100644 --- a/doc/alias/git-cherry-pick-merge/index.md +++ b/doc/git-cherry-pick-merge/index.md @@ -2,7 +2,9 @@ ## Cherry pick a merge commit -```gitconfig +Git alias: + +```git cherry-pick-merge = !"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'" @@ -14,6 +16,6 @@ TODO: write summary Example: -```sh +```shell $ git cherry-pick-merge ``` diff --git a/doc/git-churn/index.html b/doc/git-churn/index.html new file mode 100644 index 00000000..7ff13a74 --- /dev/null +++ b/doc/git-churn/index.html @@ -0,0 +1,97 @@ + + + + + + git churn - GitAlias + + + + + + + + + +
+

git churn

+

Show log of files that have many changes

+

Git alias:

+
churn = !"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"
+
+

Show churn for whole repo:

+
$ git churn
+
+

Show churn for specific directories:

+
$ git churn app lib
+
+

Show churn for a time range:

+
$ git churn --since=1-month-ago
+
+

These are all standard arguments to git log.

+

It’s possible to get valuable insight from history of a project not only +by viewing individual commits, but by analyzing sets of changes as a whole.

+

For instance, git churn compiles stats about which files change the most.

+

For example, to see where work on an app was focused on in the past month:

+
$ git churn --since=1-month-ago app/ | tail
+
+

This can also highlight potential problems with technical debt in a project. +A specific file changing too often is generally a red flag, since it probably +means the file either needed to be frequently fixed for bugs, or the file +holds too much responsibility and should be split into smaller units.

+

Similar methods of history analysis can be employed to see which people were +responsible recently for development of a certain part of the codebase.

+

For instance, to see who contributed most to the API part of an application:

+
$ git log --format='%an' --since=1-month-ago app/controllers/api/ | sort | uniq -c | sort -rn | head
+109 Alice Anderson
+13 Bob Brown
+7 Carol Clark
+
+

Credit:

+
    +
  • +

    Written by Corey Haines

    +
  • +
  • +

    Scriptified by Gary Bernhardt

    +
  • +
  • +

    Obtained from https://github.com/garybernhardt/dotfiles/blob/main/bin/git-churn

    +
  • +
  • +

    Comments by Mislav http://mislav.uniqpath.com/2014/02/hidden-documentation/

    +
  • +
  • +

    Edited for GitAlias.com repo by Joel Parker Henderson

    +
  • +
+ +
+ + + + + diff --git a/doc/alias/git-churn/index.md b/doc/git-churn/index.md similarity index 93% rename from doc/alias/git-churn/index.md rename to doc/git-churn/index.md index 48715003..2ea009a8 100644 --- a/doc/alias/git-churn/index.md +++ b/doc/git-churn/index.md @@ -2,7 +2,9 @@ ## Show log of files that have many changes -```gitconfig +Git alias: + +```git churn = !"f() { \ git log \ --all \ @@ -19,19 +21,19 @@ churn = !"f() { \ Show churn for whole repo: -```sh +```shell $ git churn ``` Show churn for specific directories: -```sh +```shell $ git churn app lib ``` Show churn for a time range: -```sh +```shell $ git churn --since=1-month-ago ``` @@ -44,7 +46,7 @@ For instance, `git churn` compiles stats about which files change the most. For example, to see where work on an app was focused on in the past month: -```sh +```shell $ git churn --since=1-month-ago app/ | tail ``` @@ -58,7 +60,7 @@ responsible recently for development of a certain part of the codebase. For instance, to see who contributed most to the API part of an application: -```sh +```shell $ git log --format='%an' --since=1-month-ago app/controllers/api/ | sort | uniq -c | sort -rn | head 109 Alice Anderson 13 Bob Brown @@ -67,7 +69,7 @@ $ git log --format='%an' --since=1-month-ago app/controllers/api/ | sort | uniq Credit: -* Written by (Corey Haines)[http://coreyhaines.com/] +* Written by [Corey Haines](http://coreyhaines.com/) * Scriptified by Gary Bernhardt diff --git a/doc/alias/git-ci/index.md b/doc/git-ci/index.md similarity index 75% rename from doc/alias/git-ci/index.md rename to doc/git-ci/index.md index a9ef1feb..3b58c906 100644 --- a/doc/alias/git-ci/index.md +++ b/doc/git-ci/index.md @@ -2,12 +2,14 @@ ## Commit interactive -```gitconfig +Git alias: + +```git ci = commit --interactive ``` Example: -```sh +```shell $ git ci ``` diff --git a/doc/git-cleaner/index.html b/doc/git-cleaner/index.html new file mode 100644 index 00000000..16e3614b --- /dev/null +++ b/doc/git-cleaner/index.html @@ -0,0 +1,57 @@ + + + + + + git cleaner - GitAlias + + + + + + + + + +
+

git cleaner

+

Use git clean to make everything pristine

+

Git alias:

+
cleaner = clean -ffdx
+
+

Example:

+
$ git cleaner
+
+

This will remove untracked files from the working tree.

+

Documentation of git clean flags

+
+
-d
+
Normally, when no <path> is specified, git clean will not recurse into untracked directories to avoid removing too much. Specify -d to have it recurse into such directories as well. If any paths are specified, -d is irrelevant; all untracked files matching the specified paths (with exceptions for nested git directories mentioned under --force) will be removed.
+
-f, --force
+
If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or directories unless given -f or -i. Git will refuse to modify untracked nested git repositories (directories with a +.git subdirectory) unless a second -f is given.
+
-x
+
Don't use the standard ignore rules (see gitignore(5)), but still use the ignore rules given with -e options from the command line. This allows removing all untracked files, including build products. This can be used (possibly in +conjunction with git restore or git reset) to create a pristine working directory to test a clean build.
+
+
+ + + + + diff --git a/doc/git-cleaner/index.md b/doc/git-cleaner/index.md new file mode 100644 index 00000000..196db359 --- /dev/null +++ b/doc/git-cleaner/index.md @@ -0,0 +1,31 @@ +# git cleaner + +## Use git clean to make everything pristine + +Git alias: + +```git +cleaner = clean -ffdx +``` + +Example: + +```shell +$ git cleaner +``` + +This will remove untracked files from the working tree. + + +### Documentation of `git clean` flags + +
+
-d
+
Normally, when no <path> is specified, git clean will not recurse into untracked directories to avoid removing too much. Specify -d to have it recurse into such directories as well. If any paths are specified, -d is irrelevant; all untracked files matching the specified paths (with exceptions for nested git directories mentioned under --force) will be removed.
+
-f, --force
+
If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or directories unless given -f or -i. Git will refuse to modify untracked nested git repositories (directories with a +.git subdirectory) unless a second -f is given.
+
-x
+
Don't use the standard ignore rules (see gitignore(5)), but still use the ignore rules given with -e options from the command line. This allows removing all untracked files, including build products. This can be used (possibly in +conjunction with git restore or git reset) to create a pristine working directory to test a clean build.
+
diff --git a/doc/alias/git-cleanout/index.md b/doc/git-cleanout/index.md similarity index 85% rename from doc/alias/git-cleanout/index.md rename to doc/git-cleanout/index.md index 08ed5f66..dc0c7e41 100644 --- a/doc/alias/git-cleanout/index.md +++ b/doc/git-cleanout/index.md @@ -2,12 +2,14 @@ ## Clean and discard changes and untracked files in working tree -```gitconfig +Git alias: + +```git cleanout = !git clean -df && git checkout -- . ``` Example: -```sh +```shell $ git cleanout ``` diff --git a/doc/alias/git-clone-lean/index.md b/doc/git-clone-lean/index.md similarity index 97% rename from doc/alias/git-clone-lean/index.md rename to doc/git-clone-lean/index.md index 6fe7bdf4..4b61a3c4 100644 --- a/doc/alias/git-clone-lean/index.md +++ b/doc/git-clone-lean/index.md @@ -2,13 +2,15 @@ ## Clone as lean as possible -```gitconfig +Git alias: + +```git clone-lean = clone --depth 1 --filter=combine:blob:none+tree:0 --no-checkout ``` Example: -```sh +```shell $ git clone-lean ``` diff --git a/doc/alias/git-cloner/index.md b/doc/git-cloner/index.md similarity index 83% rename from doc/alias/git-cloner/index.md rename to doc/git-cloner/index.md index 4507e0a0..4ebc2453 100644 --- a/doc/alias/git-cloner/index.md +++ b/doc/git-cloner/index.md @@ -2,12 +2,14 @@ ## Clone a repository and recurse on any of its submodules -```gitconfig +Git alias: + +```git cloner = clone --recurse-submodules ``` Example: -```sh +```shell $ git cloner ``` diff --git a/doc/alias/git-cm/index.md b/doc/git-cm/index.md similarity index 75% rename from doc/alias/git-cm/index.md rename to doc/git-cm/index.md index 75dcb9e6..d499ba53 100644 --- a/doc/alias/git-cm/index.md +++ b/doc/git-cm/index.md @@ -2,12 +2,14 @@ ## Commit with a message -```gitconfig +Git alias: + +```git cm = commit --message ``` Example: -```sh +```shell $ git cm ``` diff --git a/doc/alias/git-co/index.md b/doc/git-co/index.md similarity index 81% rename from doc/alias/git-co/index.md rename to doc/git-co/index.md index 65cdd5af..b44dd62d 100644 --- a/doc/alias/git-co/index.md +++ b/doc/git-co/index.md @@ -2,12 +2,14 @@ ## Checkout a.k.a. update the working tree to match a branch or paths -```gitconfig +Git alias: + +```git co = checkout ``` Example: -```sh +```shell $ git co ``` diff --git a/doc/alias/git-cog/index.md b/doc/git-cog/index.md similarity index 76% rename from doc/alias/git-cog/index.md rename to doc/git-cog/index.md index 166d26ac..b3928df4 100644 --- a/doc/alias/git-cog/index.md +++ b/doc/git-cog/index.md @@ -2,12 +2,14 @@ ## Checkout with guessing -```gitconfig +Git alias: + +```git cog = checkout --guess ``` Example: -```sh +```shell $ git cog ``` diff --git a/doc/alias/git-commit-is-merge/index.md b/doc/git-commit-is-merge/index.md similarity index 90% rename from doc/alias/git-commit-is-merge/index.md rename to doc/git-commit-is-merge/index.md index a129acf9..ae298526 100644 --- a/doc/alias/git-commit-is-merge/index.md +++ b/doc/git-commit-is-merge/index.md @@ -2,7 +2,9 @@ ## Is the commit a merge commit? If yes exit 0, else exit 1 -```gitconfig +Git alias: + +```git commit-is-merge = !"f(){ \ [ -n \"$(git commit-parents \"$*\" | sed '0,/^parent /d')\" ]; \ };f" @@ -10,6 +12,6 @@ commit-is-merge = !"f(){ \ Example: -```sh +```shell $ git commit-is-merge && do-something || do-something-else ``` diff --git a/doc/alias/git-commit-message-key-lines/index.md b/doc/git-commit-message-key-lines/index.md similarity index 94% rename from doc/alias/git-commit-message-key-lines/index.md rename to doc/git-commit-message-key-lines/index.md index 2ec5b23c..43dc30c5 100644 --- a/doc/alias/git-commit-message-key-lines/index.md +++ b/doc/git-commit-message-key-lines/index.md @@ -1,8 +1,10 @@ # git commit-message-key-lines -## Show the commit's keyword-marker lines. +## Show the commit's keyword-marker lines -```gitconfig +Git alias: + +```git commit-message-key-lines = "!f(){ \ echo \"Commit: $1\"; git log \"$1\" --format=fuller | \ grep \"^[[:blank:]]*[[:alnum:]][-[:alnum:]]*:\" | \ @@ -12,7 +14,7 @@ commit-message-key-lines = "!f(){ \ Example: -```sh +```shell $ git commit-message-key-lines ce505d161fccdbc8d4bf12047846de7433ad6d04 ``` @@ -22,7 +24,7 @@ then a colon. The purpose is to help with analytics and reports. Example commit and message: -```sh +```shell commit ce505d161fccdbc8d4bf12047846de7433ad6d04 Author: Alice Adams Date: Tue May 28 11:53:47 2019 -0700 @@ -37,13 +39,13 @@ Date: Tue May 28 11:53:47 2019 -0700 Example command: -```sh +```shell $ git commit-message-key-lines ce505d161fccdbc8d4bf12047846de7433ad6d04 ``` Example output: -```sh +```shell Commit: ce505d161fccdbc8d4bf12047846de7433ad6d04 Author: Alice Adams Date: Tue May 28 11:53:47 2019 -0700 diff --git a/doc/alias/git-commit-parents/index.md b/doc/git-commit-parents/index.md similarity index 87% rename from doc/alias/git-commit-parents/index.md rename to doc/git-commit-parents/index.md index 6b7b1c91..c2f508fe 100644 --- a/doc/alias/git-commit-parents/index.md +++ b/doc/git-commit-parents/index.md @@ -2,7 +2,9 @@ ## Show the commit's parents -```gitconfig +Git alias: + +```git commit-parents = !"f(){ \ git cat-file -p \"${*:-HEAD}\" | \ sed -n '/0/,/^ *$/{/^parent /p}'; \ @@ -11,6 +13,6 @@ commit-parents = !"f(){ \ Example: -```sh +```shell $ git commit-parents ``` diff --git a/doc/alias/git-cong/index.md b/doc/git-cong/index.md similarity index 77% rename from doc/alias/git-cong/index.md rename to doc/git-cong/index.md index 0425b1b9..5a632de4 100644 --- a/doc/alias/git-cong/index.md +++ b/doc/git-cong/index.md @@ -2,12 +2,14 @@ ## Checkout with no guessing -```gitconfig +Git alias: + +```git cong = checkout --no-guess ``` Example: -```sh +```shell $ git cong ``` diff --git a/doc/git-count/index.md b/doc/git-count/index.md new file mode 100644 index 00000000..e69de29b diff --git a/doc/alias/git-cp/index.md b/doc/git-cp/index.md similarity index 87% rename from doc/alias/git-cp/index.md rename to doc/git-cp/index.md index 767ff86b..e9a62388 100644 --- a/doc/alias/git-cp/index.md +++ b/doc/git-cp/index.md @@ -2,13 +2,15 @@ ## Cherry-pick - apply the changes introduced by some existing commits; -```gitconfig +Git alias: + +```git cp = cherry-pick ``` Example: -```sh +```shell $ git cp ``` diff --git a/doc/alias/git-cpa/index.md b/doc/git-cpa/index.md similarity index 78% rename from doc/alias/git-cpa/index.md rename to doc/git-cpa/index.md index 66c1f679..51cf56e1 100644 --- a/doc/alias/git-cpa/index.md +++ b/doc/git-cpa/index.md @@ -2,12 +2,14 @@ ## Abort the cherry-pick process -```gitconfig +Git alias: + +```git cpa = cherry-pick --abort ``` Example: -```sh +```shell $ git cpa ``` diff --git a/doc/alias/git-cpc/index.md b/doc/git-cpc/index.md similarity index 79% rename from doc/alias/git-cpc/index.md rename to doc/git-cpc/index.md index 6a901e48..3db4af13 100644 --- a/doc/alias/git-cpc/index.md +++ b/doc/git-cpc/index.md @@ -2,12 +2,14 @@ ## Continue the cherry-pick process -```gitconfig +Git alias: + +```git cpc = cherry-pick --continue ``` Example: -```sh +```shell $ git cpc ``` diff --git a/doc/alias/git-cpn/index.md b/doc/git-cpn/index.md similarity index 76% rename from doc/alias/git-cpn/index.md rename to doc/git-cpn/index.md index f16d0ea2..5a159804 100644 --- a/doc/alias/git-cpn/index.md +++ b/doc/git-cpn/index.md @@ -2,12 +2,14 @@ ## Cherry-pick with no commit -```gitconfig +Git alias: + +```git cpn = cherry-pick -n ``` Example: -```sh +```shell $ git cpn ``` diff --git a/doc/alias/git-cpnx/index.md b/doc/git-cpnx/index.md similarity index 90% rename from doc/alias/git-cpnx/index.md rename to doc/git-cpnx/index.md index c79db26f..aec14e1c 100644 --- a/doc/alias/git-cpnx/index.md +++ b/doc/git-cpnx/index.md @@ -2,13 +2,15 @@ ## Cherry-pick with no commit and with explanation -```gitconfig +Git alias: + +```git cpnx = cherry-pick -n -x ``` Example: -```sh +```shell $ git cpnx ``` diff --git a/doc/git-cull-branches/index.md b/doc/git-cull-branches/index.md new file mode 100644 index 00000000..16d7692d --- /dev/null +++ b/doc/git-cull-branches/index.md @@ -0,0 +1,20 @@ +# git cull-branches + +## Delete branches that have been merged into the upstream commit + +Git alias: + +```git +cull-branches = !git cull-local-branches; git cull-remote-branches; +``` + +Example: + +```shell +$ git cull-branches +``` + +To see how this works, see these: + +* [git cull-local-branches](../git-cull-local-branches) +* [git cull-remote-branches](../git-cull-remote-branches) diff --git a/doc/alias/git-cull-locals/index.md b/doc/git-cull-local-branches/index.md similarity index 57% rename from doc/alias/git-cull-locals/index.md rename to doc/git-cull-local-branches/index.md index 48d21e4e..ebc2d49a 100644 --- a/doc/alias/git-cull-locals/index.md +++ b/doc/git-cull-local-branches/index.md @@ -1,10 +1,12 @@ -# git cull-locals +# git cull-local-branches ## Delete local branches that have been merged -```gitconfig -cull-locals = !"f() { \ - commit=${1:-$(git current-branch)}; \ +Git alias: + +```git +cull-local-branches = !"f() { \ + commit=${1:-$(git my-branch)}; \ git branch --merged \"$commit" | \ xargs git branch --delete }; f \"$@\"" @@ -12,24 +14,24 @@ cull-locals = !"f() { \ Syntax: -```sh -cull-locals [] +```shell +cull-local-branches [] ``` Example that uses the default i.e. current branch name: -```sh -$ git cull-locals +```shell +$ git cull-local-branches ``` Example with a specific branch name: -```sh -$ git cull-locals main +```shell +$ git cull-local-branches main ``` If a branch is provided, or commit is provided, then this alias will use it. Otherwise, this alias will use the current branch name. -Compare [git cull-remotes](../git-cull-remotes). +Compare [git cull-remote-branches](../git-cull-remote-branches). diff --git a/doc/alias/git-cull-remotes/index.md b/doc/git-cull-remote-branches/index.md similarity index 66% rename from doc/alias/git-cull-remotes/index.md rename to doc/git-cull-remote-branches/index.md index 03ae0fed..1e91f319 100644 --- a/doc/alias/git-cull-remotes/index.md +++ b/doc/git-cull-remote-branches/index.md @@ -1,9 +1,11 @@ -# git cull-remotes +# git cull-remote-branches ## Delete remote branches that have been merged into the upstream commit -```gitconfig -cull-remotes = !"f() { \ +Git alias: + +```git +cull-remote-branches = !"f() { \ commit=${1:-$(git upstream-branch-name)}; \ git branch --remotes --merged "$commit" | \ grep -v "^[[:space:]]*$upstream_name$" \ @@ -14,31 +16,31 @@ cull-remotes = !"f() { \ Example: -```sh -$ git cull-remotes +```shell +$ git cull-remote-branches ``` Syntax: -```sh -git cull-remotes [] +```shell +git cull-remote-branches [] ``` Example that uses the default i.e. upstream branch name: -```sh -git cull-remotes main +```shell +git cull-remote-branches main ``` Example that uses a specific branch name: -```sh -git cull-remotes main +```shell +git cull-remote-branches main ``` If a branch is provided, or a commit is provided, then this alias will use it. Otherwise, this alias will use the upstream branch name. -Compare [git cull-locals](../git-cull-locals). +Compare [git cull-local-branches](../git-cull-local-branches). diff --git a/doc/git-cvs-e/index.md b/doc/git-cvs-e/index.md new file mode 100644 index 00000000..7ffbadaa --- /dev/null +++ b/doc/git-cvs-e/index.md @@ -0,0 +1,15 @@ +# git cvs-e + +## CVS export + +Git alias: + +```git +cvs-e = cvsexportcommit -u -p +``` + +Example: + +```shell +$ git cvs-e +``` diff --git a/doc/git-cvs-i/index.md b/doc/git-cvs-i/index.md new file mode 100644 index 00000000..08591cec --- /dev/null +++ b/doc/git-cvs-i/index.md @@ -0,0 +1,15 @@ +# git cvs-i + +## CVS import + +Git alias: + +```git +cvs-i = cvsimport -k -a +``` + +Example: + +```shell +$ git cvs-i +``` diff --git a/doc/alias/git-cvs/index.md b/doc/git-cvs/index.md similarity index 85% rename from doc/alias/git-cvs/index.md rename to doc/git-cvs/index.md index db51d19f..dfe5ea29 100644 --- a/doc/alias/git-cvs/index.md +++ b/doc/git-cvs/index.md @@ -2,14 +2,16 @@ ## Aliases for working with CVS version control -```gitconfig +Git alias: + +```git cvs-i = cvsimport -k -a cvs-e = cvsexportcommit -u -p ``` Example: -```sh +```shell $ git cvs-i $ git cvs-e ``` diff --git a/doc/git-d/index.md b/doc/git-d/index.md new file mode 100644 index 00000000..4608185b --- /dev/null +++ b/doc/git-d/index.md @@ -0,0 +1,15 @@ +# git d + +## Short for "git diff" + +Git alias: + +```git +d = diff +``` + +Example: + +```shell +$ git d +``` diff --git a/doc/alias/git-dc/index.md b/doc/git-dc/index.md similarity index 79% rename from doc/alias/git-dc/index.md rename to doc/git-dc/index.md index d5100b4d..ed6ed99f 100644 --- a/doc/alias/git-dc/index.md +++ b/doc/git-dc/index.md @@ -2,12 +2,14 @@ ## Diff in order to show changes not yet staged -```gitconfig +Git alias: + +```git dc = diff --cached ``` Example: -```sh +```shell $ git dc ``` diff --git a/doc/alias/git-dd/index.md b/doc/git-dd/index.md similarity index 87% rename from doc/alias/git-dd/index.md rename to doc/git-dd/index.md index 175fe4b8..24ed765e 100644 --- a/doc/alias/git-dd/index.md +++ b/doc/git-dd/index.md @@ -2,13 +2,15 @@ ## Diff deep - show changes with our preferred options -```gitconfig +Git alias: + +```git dd = diff --check --dirstat --find-copies --find-renames --histogram --color ``` Example: -```sh +```shell $ git dd ``` diff --git a/doc/alias/git-debug/index.md b/doc/git-debug/index.md similarity index 92% rename from doc/alias/git-debug/index.md rename to doc/git-debug/index.md index 0c4d2b81..ca76ad01 100644 --- a/doc/alias/git-debug/index.md +++ b/doc/git-debug/index.md @@ -2,13 +2,15 @@ ## Help debugging builtins -```gitconfig +Git alias: + +```git debug = !GIT_PAGER= gdb --args git ``` Example: -```sh +```shell $ git debug ``` diff --git a/doc/alias/git-default-branch/index.md b/doc/git-default-branch/index.md similarity index 83% rename from doc/alias/git-default-branch/index.md rename to doc/git-default-branch/index.md index 5a292920..e316fe92 100644 --- a/doc/alias/git-default-branch/index.md +++ b/doc/git-default-branch/index.md @@ -2,13 +2,15 @@ ## Get the default branch name -```gitconfig +Git alias: + +```git default-branch = config init.defaultBranch ``` Example: -```sh +```shell $ git default-branch main ``` diff --git a/doc/git-diff-all/index.md b/doc/git-diff-all/index.md new file mode 100644 index 00000000..456918b6 --- /dev/null +++ b/doc/git-diff-all/index.md @@ -0,0 +1,15 @@ +# git diff-all + +## For each diff, call difftool + +Git alias: + +```git +diff-all = !"for name in $(git diff --name-only $1); do git difftool $1 $name & done" +``` + +Example: + +```shell +$ git diff-all +``` diff --git a/doc/git-diff-changes/index.md b/doc/git-diff-changes/index.md new file mode 100644 index 00000000..663f356b --- /dev/null +++ b/doc/git-diff-changes/index.md @@ -0,0 +1,15 @@ +# git diff-changes + +## Show diff of changes + +Git alias: + +```git +diff-changes = diff --name-status -r +``` + +Example: + +```shell +git diff-changes +``` diff --git a/doc/alias/git-diff-chunk/index.md b/doc/git-diff-chunk/index.md similarity index 94% rename from doc/alias/git-diff-chunk/index.md rename to doc/git-diff-chunk/index.md index a869407d..8f8da1d2 100644 --- a/doc/alias/git-diff-chunk/index.md +++ b/doc/git-diff-chunk/index.md @@ -2,7 +2,9 @@ ## Show the diff of one chunk -```gitconfig +Git alias: + +```git diff-chunk = "!f() { \ git show \"\$1:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp1 ; \ git show \"\$2:\$3\" | sed -n \"/^[^ \t].*\$4(/,/^}/p\" > .tmp2 ; \ @@ -12,7 +14,7 @@ diff-chunk = "!f() { \ Example: -```sh +```shell $ git diff-chunk ``` @@ -24,6 +26,6 @@ then does a typical git diff. Syntax: -```sh +```shell $ git funcdiff ``` diff --git a/doc/git-diff-deep/index.md b/doc/git-diff-deep/index.md new file mode 100644 index 00000000..d44267a2 --- /dev/null +++ b/doc/git-diff-deep/index.md @@ -0,0 +1,15 @@ +# git diff-deep + +## Diff with deep information using our preferred options, a.k.a. `dd` + +Git alias: + +```git +diff-deep = diff --check --dirstat --find-copies --find-renames --histogram --color +``` + +Example: + +```shell +$ git diff-deep +``` diff --git a/doc/git-diff-staged/index.md b/doc/git-diff-staged/index.md new file mode 100644 index 00000000..1da1b4d2 --- /dev/null +++ b/doc/git-diff-staged/index.md @@ -0,0 +1,15 @@ +# git diff-staged + +## Show diffs that are cached i.e. staged + +Git alias: + +```git +diff-staged = diff --cached +``` + +Example: + +```shell +$ git diff-staged +``` diff --git a/doc/git-diff-stat/index.md b/doc/git-diff-stat/index.md new file mode 100644 index 00000000..410f2929 --- /dev/null +++ b/doc/git-diff-stat/index.md @@ -0,0 +1,15 @@ +# git diff-stat + +## Diff with stat + +Git alias: + +```git +diff-stat = diff --stat --ignore-space-change -r +``` + +Example: + +```shell +git diff-stat +``` diff --git a/doc/alias/git-diff/index.md b/doc/git-diff/index.md similarity index 94% rename from doc/alias/git-diff/index.md rename to doc/git-diff/index.md index 88d11f2b..4e0d405d 100644 --- a/doc/alias/git-diff/index.md +++ b/doc/git-diff/index.md @@ -2,7 +2,9 @@ ## Show diff in various ways -```gitconfig +Git alias: + +```git diff-all = !"for name in $(git diff --name-only $1); do git difftool $1 $name & done" diff-changes = diff --name-status -r diff-stat = diff --stat --ignore-space-change -r @@ -14,7 +16,7 @@ diff-deep = diff --check --dirstat --find-copies --find-renames --histogram --co Example: -```sh +```shell $ git diff-all $ git diff-changes $ git diff-stat diff --git a/doc/git-discard/index.md b/doc/git-discard/index.md new file mode 100644 index 00000000..61dd7130 --- /dev/null +++ b/doc/git-discard/index.md @@ -0,0 +1,13 @@ +# git discard + +## Discard changes in a file (or a list of files) in working tree + +```gitalias +discard = checkout -- +``` + +Example: + +```shell +$ git discard foo goo hoo +``` diff --git a/doc/alias/git-ds/index.md b/doc/git-ds/index.md similarity index 77% rename from doc/alias/git-ds/index.md rename to doc/git-ds/index.md index be89c7e3..04451d03 100644 --- a/doc/alias/git-ds/index.md +++ b/doc/git-ds/index.md @@ -2,12 +2,14 @@ ## Show changes about to be commited -```gitconfig +Git alias: + +```git ds = diff --staged ``` Example: -```sh +```shell $ git ds ``` diff --git a/doc/git-dw/index.md b/doc/git-dw/index.md new file mode 100644 index 00000000..c4367d0f --- /dev/null +++ b/doc/git-dw/index.md @@ -0,0 +1,15 @@ +# git dw + +## Show changes by word, not line + +Git alias: + +```git +dw = diff --word-diff +``` + +Example: + +```shell +git dw +``` diff --git a/doc/alias/git-dwd/index.md b/doc/git-dwd/index.md similarity index 78% rename from doc/alias/git-dwd/index.md rename to doc/git-dwd/index.md index 7306d64b..ca399e0e 100644 --- a/doc/alias/git-dwd/index.md +++ b/doc/git-dwd/index.md @@ -2,12 +2,14 @@ ## Show changes by word, not by line -```gitconfig +Git alias: + +```git dwd = diff --word-diff ``` Example: -```sh +```shell $ git dwd ``` diff --git a/doc/git-edit-cached/index.md b/doc/git-edit-cached/index.md new file mode 100644 index 00000000..80c23a74 --- /dev/null +++ b/doc/git-edit-cached/index.md @@ -0,0 +1,37 @@ +# git edit-cached + +## Edit cached files + +Git alias: + +```git +edit-cached = !"f() { git ls-files --cached | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-cached +``` + +Compare: + +* [git edit-cached](../git-edit-cached) (this alias) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-deleted/index.md b/doc/git-edit-deleted/index.md new file mode 100644 index 00000000..1db46964 --- /dev/null +++ b/doc/git-edit-deleted/index.md @@ -0,0 +1,37 @@ +# git edit-deleted + +## Edit deleted files + +Git alias: + +```git +edit-deleted = !"f() { git ls-files --deleted | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-cached +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) (this alias) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-ignored/index.md b/doc/git-edit-ignored/index.md new file mode 100644 index 00000000..3f09686d --- /dev/null +++ b/doc/git-edit-ignored/index.md @@ -0,0 +1,37 @@ +# git edit-ignored + +## Edit ignored files + +Git alias: + +```git +edit-ignored = !"f() { git ls-files --ignored | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-ignored +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) (this alias) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-killed/index.md b/doc/git-edit-killed/index.md new file mode 100644 index 00000000..de4e1d4c --- /dev/null +++ b/doc/git-edit-killed/index.md @@ -0,0 +1,37 @@ +# git edit-killed + +## Edit killed files + +Git alias: + +```git +edit-killed = !"f() { git ls-files --killed | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-killed +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) (this alias) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-modified/index.md b/doc/git-edit-modified/index.md new file mode 100644 index 00000000..f5f231dd --- /dev/null +++ b/doc/git-edit-modified/index.md @@ -0,0 +1,37 @@ +# git edit-modified + +## Edit modified files + +Git alias: + +```git +edit-modified = !"f() { git ls-files --modified | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-modified +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) (this alias) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-others/index.md b/doc/git-edit-others/index.md new file mode 100644 index 00000000..6f323ec2 --- /dev/null +++ b/doc/git-edit-others/index.md @@ -0,0 +1,37 @@ +# git edit-others + +## Edit other files + +Git alias: + +```git +edit-others = !"f() { git ls-files --others | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-cached +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) (this alias) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-stage/index.md b/doc/git-edit-stage/index.md new file mode 100644 index 00000000..94d83d79 --- /dev/null +++ b/doc/git-edit-stage/index.md @@ -0,0 +1,37 @@ +# git edit-stage + +## Edit stage files + +Git alias: + +```git +edit-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-stage +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) (this alias) +* [git edit-unmerged](../git-edit-unmerged) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/git-edit-unmerged/index.md b/doc/git-edit-unmerged/index.md new file mode 100644 index 00000000..f651834f --- /dev/null +++ b/doc/git-edit-unmerged/index.md @@ -0,0 +1,37 @@ +# git edit-unmerged + +## Edit unmerged files + +Git alias: + +```git +edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; `git var GIT_EDITOR` `f`" +``` + +Example: + +```shell +$ git edit-cached +``` + +Compare: + +* [git edit-cached](../git-edit-cached) +* [git edit-deleted](../git-edit-deleted) +* [git edit-others](../git-edit-others) +* [git edit-ignored](../git-edit-ignored) +* [git edit-killed](../git-edit-killed) +* [git edit-modified](../git-edit-modified) +* [git edit-stage](../git-edit-stage) +* [git edit-unmerged](../git-edit-unmerged) (this alias) + +Compare corresponding aliases for add-*: + +* [git add-cached](../git-add-cached) +* [git add-deleted](../git-add-deleted) +* [git add-others](../git-add-others) +* [git add-ignored](../git-add-ignored) +* [git add-killed](../git-add-killed) +* [git add-modified](../git-add-modified) +* [git add-stage](../git-add-stage) +* [git add-unmerged](../git-add-unmerged) diff --git a/doc/alias/git-edit/index.md b/doc/git-edit/index.md similarity index 97% rename from doc/alias/git-edit/index.md rename to doc/git-edit/index.md index 1b0c37f6..f3091e60 100644 --- a/doc/alias/git-edit/index.md +++ b/doc/git-edit/index.md @@ -2,7 +2,9 @@ ## Edit all files of a given type -```gitconfig +Git alias: + +```git edit-cached = !"f() { git ls-files --cached | sort -u ; }; `git var GIT_EDITOR` `f`" edit-deleted = !"f() { git ls-files --deleted | sort -u ; }; `git var GIT_EDITOR` `f`" edit-others = !"f() { git ls-files --others | sort -u ; }; `git var GIT_EDITOR` `f`" @@ -15,7 +17,7 @@ edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; `git va Example: -```sh +```shell $ git edit-cached $ git edit-deleted $ git edit-others diff --git a/doc/git-exec/index.html b/doc/git-exec/index.html new file mode 100644 index 00000000..4df778b6 --- /dev/null +++ b/doc/git-exec/index.html @@ -0,0 +1,29 @@ + + + + + + git exec - GitAlias.com + + + + +
+
+

git exec

+

Execute a shell script

+
exec = ! exec
+
+

Example:

+
$ git exec pwd
+/home/alice/projects/example
+
+

Note: git always runs scripts in the top directory.

+ +
+
+ + diff --git a/doc/alias/git-exec/index.md b/doc/git-exec/index.md similarity index 85% rename from doc/alias/git-exec/index.md rename to doc/git-exec/index.md index 5a14f9eb..55c18498 100644 --- a/doc/alias/git-exec/index.md +++ b/doc/git-exec/index.md @@ -2,13 +2,15 @@ ## Execute a shell script -```gitconfig +Git alias: + +```git exec = ! exec ``` Example: -```sh +```shell $ git exec pwd /home/alice/projects/example ``` diff --git a/doc/git-expunge/index.html b/doc/git-expunge/index.html new file mode 100644 index 00000000..afffbee8 --- /dev/null +++ b/doc/git-expunge/index.html @@ -0,0 +1,38 @@ + + + + + + git expunge - GitAlias.com + + + + +
+
+

git expunge

+

Delete a file everywhere

+
expunge = !"f() { \
+    git filter-branch \
+    --force \
+    --index-filter \"git rm --cached --ignore-unmatch $1\" \
+    --prune-empty \
+    --tag-name-filter cat -- --all \
+}; f"
+
+

Example:

+
$ git expunge file.txt
+
+

This command is typically for a serious problem, such as accidentally +committing a file of sensitive data, such as passwords or secrets or +confidential information.

+

After you use this command, you will likely need to force push everything.

+

See https://help.github.com/articles/removing-sensitive-data-from-a-repository/

+ +
+
+ + diff --git a/doc/alias/git-expunge/index.md b/doc/git-expunge/index.md similarity index 95% rename from doc/alias/git-expunge/index.md rename to doc/git-expunge/index.md index a5b1408f..31c16050 100644 --- a/doc/alias/git-expunge/index.md +++ b/doc/git-expunge/index.md @@ -2,7 +2,9 @@ ## Delete a file everywhere -```gitconfig +Git alias: + +```git expunge = !"f() { \ git filter-branch \ --force \ @@ -14,7 +16,7 @@ expunge = !"f() { \ Example: -```sh +```shell $ git expunge file.txt ``` diff --git a/doc/git-f/index.md b/doc/git-f/index.md new file mode 100644 index 00000000..2d4414d2 --- /dev/null +++ b/doc/git-f/index.md @@ -0,0 +1,15 @@ +# git f + +## Short for "git fetch" + +Git alias: + +```git +f = fetch +``` + +Example: + +```shell +$ git f +``` diff --git a/doc/git-fa/index.md b/doc/git-fa/index.md new file mode 100644 index 00000000..ff07e5d2 --- /dev/null +++ b/doc/git-fa/index.md @@ -0,0 +1,15 @@ +# git fa + +## Fetch all remotes + +Git alias: + +```git +fa = fetch --all +``` + +Example: + +```shell +$ git fa +``` diff --git a/doc/git-fav/index.md b/doc/git-fav/index.md new file mode 100644 index 00000000..9091cc36 --- /dev/null +++ b/doc/git-fav/index.md @@ -0,0 +1,15 @@ +# git fav + +## Fetch all remotes, with verbose output + +Git alias: + +```git +fav = fetch --all --verbose +``` + +Example: + +```shell +$ git fav +``` diff --git a/doc/alias/git-fixup/index.md b/doc/git-fixup/index.md similarity index 92% rename from doc/alias/git-fixup/index.md rename to doc/git-fixup/index.md index 3717ae1b..0dbbaa55 100644 --- a/doc/alias/git-fixup/index.md +++ b/doc/git-fixup/index.md @@ -2,7 +2,9 @@ ## Fix a commit by amending it -```gitconfig +Git alias: + +```git fixup = "!f() { \ TARGET=$(git rev-parse \"$1\"); \ git commit --fixup=$TARGET && \ @@ -11,7 +13,7 @@ fixup = "!f() { \ Example: -```sh +```shell $ git fixup ``` diff --git a/doc/alias/git-g/index.md b/doc/git-g/index.md similarity index 72% rename from doc/alias/git-g/index.md rename to doc/git-g/index.md index 11f656e3..a930ed9f 100644 --- a/doc/alias/git-g/index.md +++ b/doc/git-g/index.md @@ -1,14 +1,16 @@ # git g -## Shortcut for "grep" +## Short for "git grep" -```gitconfig +Git alias: + +```git g = grep ``` Example: -```sh +```shell $ git g ``` diff --git a/doc/alias/git-get-git-put/index.md b/doc/git-get-git-put/index.md similarity index 78% rename from doc/alias/git-get-git-put/index.md rename to doc/git-get-git-put/index.md index 3ab685ad..49536908 100644 --- a/doc/alias/git-get-git-put/index.md +++ b/doc/git-get-git-put/index.md @@ -2,14 +2,16 @@ ## Synchronize changes for the current branch -```gitconfig +Git alias: + +```git get = !git fetch --prune && git pull --rebase && git submodule update --init --recursive put = !git commit --all && git push ``` Example: -```sh +```shell $ git get $ git put ``` @@ -22,7 +24,7 @@ Our workflow does these steps: If you want to preserve merges, then we recommend you set this: -```sh +```shell $ git config pull.rebase preserve ``` @@ -33,3 +35,11 @@ TODO: * Delete superfluous branches * Add error handing + +Compare: + +* [git get & git put](../git-get-git-put) (this page) + +* [git get](../git-get) + +* [git put](../git-put) diff --git a/doc/git-get/index.md b/doc/git-get/index.md new file mode 100644 index 00000000..e86be7e5 --- /dev/null +++ b/doc/git-get/index.md @@ -0,0 +1,23 @@ +# git get + +## Get all changes for the current branch + +Git alias: + +```git +get = !git fetch --prune && git pull --rebase && git submodule update --init --recursive +``` + +Example: + +```shell +$ git get +``` + +Compare: + +* [git get & git put](../git-get-git-put) (describes both) + +* [git get](../git-get) (this alias) + +* [git put](../git-put) diff --git a/doc/alias/git-gg/index.md b/doc/git-gg/index.md similarity index 87% rename from doc/alias/git-gg/index.md rename to doc/git-gg/index.md index efc82c7d..dfef1e73 100644 --- a/doc/alias/git-gg/index.md +++ b/doc/git-gg/index.md @@ -2,13 +2,15 @@ ## Grep group i.e. search with our preferred options -```gitconfig +Git alias: + +```git gg = grep --break --heading --line-number --color ``` Example: -```sh +```shell $ git gg ``` diff --git a/doc/alias/git-gitk-conflict/index.md b/doc/git-gitk-conflict/index.md similarity index 84% rename from doc/alias/git-gitk-conflict/index.md rename to doc/git-gitk-conflict/index.md index cce079e8..20bd0f0c 100644 --- a/doc/alias/git-gitk-conflict/index.md +++ b/doc/git-gitk-conflict/index.md @@ -2,12 +2,14 @@ ## Use gitk tool to show conflicting merge -```gitconfig +Git alias: + +```git gitk-conflict = !gitk --left-right HEAD...MERGE_HEAD ``` Example: -```sh +```shell $ git gitk-conflict ``` diff --git a/doc/alias/git-gitk-history-all/index.md b/doc/git-gitk-history-all/index.md similarity index 69% rename from doc/alias/git-gitk-history-all/index.md rename to doc/git-gitk-history-all/index.md index 0e0b50ce..6a4847bd 100644 --- a/doc/alias/git-gitk-history-all/index.md +++ b/doc/git-gitk-history-all/index.md @@ -2,12 +2,16 @@ ## Use gitk tool to show full history, including "deleted" branches and stashes -```gitconfig +Git alias: + +```git gitk-history-all = !gitk --all $( git fsck | awk '/dangling commit/ {print $3}' ) ``` Example: -```sh +```shell $ git gitk-history-all ``` + +This will show full history, including "deleted" branches and stashes. diff --git a/doc/git-gitk/index.md b/doc/git-gitk/index.md new file mode 100644 index 00000000..6b6f3b56 --- /dev/null +++ b/doc/git-gitk/index.md @@ -0,0 +1,6 @@ +# git gitk-* + +## Aliases related to the gitk tool + +* [git gitk-conflict](git-gitk-conflict) - Use gitk to show conflicting merge. +* [git gitk-history-all](git-history-all) - Use gitk to show full history. diff --git a/doc/alias/git-gn/index.md b/doc/git-gn/index.md similarity index 80% rename from doc/alias/git-gn/index.md rename to doc/git-gn/index.md index f64bde71..9edc0e64 100644 --- a/doc/alias/git-gn/index.md +++ b/doc/git-gn/index.md @@ -2,13 +2,15 @@ ## Grep and show line number -```gitconfig +Git alias: + +```git gn = grep -n ``` Example: -```sh +```shell $ git gn ``` diff --git a/doc/alias/git-graphviz/index.md b/doc/git-graphviz/index.md similarity index 91% rename from doc/alias/git-graphviz/index.md rename to doc/git-graphviz/index.md index f69ebcae..df7e6dec 100644 --- a/doc/alias/git-graphviz/index.md +++ b/doc/git-graphviz/index.md @@ -2,7 +2,9 @@ ## Use graphviz tool for display -```gitconfig +Git alias: + +```git graphviz = !"f() { \ echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; \ }; f" @@ -10,7 +12,7 @@ graphviz = !"f() { \ Example: -```sh +```shell $ git graphviz ``` @@ -18,7 +20,7 @@ This produces output that can be displayed using dotty. Example: -```sh +```shell $ git graphviz HEAD~100..HEAD~60 | dotty /dev/stdin $ git graphviz --first-parent main | dotty /dev/stdin diff --git a/doc/git-grep-ack/index.md b/doc/git-grep-ack/index.md new file mode 100644 index 00000000..e69de29b diff --git a/doc/git-grep-all/index.md b/doc/git-grep-all/index.md new file mode 100644 index 00000000..5663ef40 --- /dev/null +++ b/doc/git-grep-all/index.md @@ -0,0 +1,21 @@ +# git grep-all + +## Find text in any commit ever + +Git alias: + +```git +grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f" +``` + +Syntax: + +```shell +git grep-all … +``` + +Example: + +```shell +$ git grep-all foo +``` diff --git a/doc/git-grep-group/index.md b/doc/git-grep-group/index.md new file mode 100644 index 00000000..74e2dadf --- /dev/null +++ b/doc/git-grep-group/index.md @@ -0,0 +1,21 @@ +# git grep-group + +## Find text and group the output lines, a.k.a. `gg` + +Git alias: + +```git +grep-group = grep --break --heading --line-number --color +``` + +Syntax: + +```shell +$ git grep-group [options] +``` + +Example: + +```shell +$ git grep-group foo +``` diff --git a/doc/alias/git-grep/index.md b/doc/git-grep/index.md similarity index 95% rename from doc/alias/git-grep/index.md rename to doc/git-grep/index.md index 6c58bdc8..4c7d363a 100644 --- a/doc/alias/git-grep/index.md +++ b/doc/git-grep/index.md @@ -2,7 +2,9 @@ ## Grep helpers -```gitconfig +Git alias: + +```git # Find text in any commit ever. grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f" @@ -19,7 +21,7 @@ grep-ack = \ Example: -```sh +```shell $ git grep-all $ git grep-group $ git grep-ack diff --git a/doc/git-heads/index.md b/doc/git-heads/index.md new file mode 100644 index 00000000..41d81dd2 --- /dev/null +++ b/doc/git-heads/index.md @@ -0,0 +1,17 @@ +# git heads + +## Show log of heads + +Git alias: + +```git +heads = !"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';'" +``` + +Example: + +```shell +$ git heads +``` + +From https://gist.github.com/492227 diff --git a/doc/git-ignore/index.md b/doc/git-ignore/index.md new file mode 100644 index 00000000..77a6095b --- /dev/null +++ b/doc/git-ignore/index.md @@ -0,0 +1,15 @@ +# git ignore + +## Ignore all untracked files by appending them to ".gitignore" + +Git alias: + +```gitalias +ignore = "!git status | grep -P \"^\\t\" | grep -vF .gitignore | sed \"s/^\\t//\" >> .gitignore" +``` + +Example: + +```shell +$ git ignore +``` diff --git a/doc/alias/git-inbound/index.md b/doc/git-inbound/index.md similarity index 87% rename from doc/alias/git-inbound/index.md rename to doc/git-inbound/index.md index f13a6cb3..948b1130 100644 --- a/doc/alias/git-inbound/index.md +++ b/doc/git-inbound/index.md @@ -2,13 +2,15 @@ ## Show incoming changes compared to upstream -```gitconfig +Git alias: + +```git inbound = !git remote update --prune; git log ..@{upstream} ``` Example: -```sh +```shell $ git inbound ``` diff --git a/doc/git-init-empty/index.md b/doc/git-init-empty/index.md new file mode 100644 index 00000000..9706b387 --- /dev/null +++ b/doc/git-init-empty/index.md @@ -0,0 +1,21 @@ +# git init-empty + +## Initalize a repo with an empty rebaseable commit + +Git alias: + +```git +init-empty = !"f() { \ + git init && \ + git commit --allow-empty --allow-empty-message --message ''; \ +}; f" +``` + +Example: + +```shell +$ git init-empty +``` + +This initialization makes it easier to do later git rebase commands, +because it enables a rebase to go all the way back to the first commit. diff --git a/doc/alias/git-intercommit/index.md b/doc/git-intercommit/index.md similarity index 93% rename from doc/alias/git-intercommit/index.md rename to doc/git-intercommit/index.md index 16190ca7..dffaecd8 100644 --- a/doc/alias/git-intercommit/index.md +++ b/doc/git-intercommit/index.md @@ -2,13 +2,15 @@ ## Use interdiff to see patch modifications -```gitconfig +Git alias: + +```git intercommit = !sh -c 'git show "$1" > .git/commit1 && git show "$2" > .git/commit2 && interdiff .git/commit[12] | less -FRS' - ``` Example: -```sh +```shell $ git intercommit ``` diff --git a/doc/alias/git-issues/index.md b/doc/git-issues/index.md similarity index 92% rename from doc/alias/git-issues/index.md rename to doc/git-issues/index.md index daef771e..0f26da88 100644 --- a/doc/alias/git-issues/index.md +++ b/doc/git-issues/index.md @@ -2,13 +2,15 @@ ## List all issues mentioned in commit messages between range of commits -```gitconfig +Git alias: + +```git issues = !sh -c \"git log $1 --oneline | grep -o \\\"ISSUE-[0-9]\\+\\\" | sort -u\" ``` Example: -```sh +```shell $ git issues ``` @@ -20,13 +22,13 @@ For Jira it should be as simple as putting your project name in place of `ISSUE` Best used with tags: -```sh +```shell $ git issues v1.0..v1.1 ``` This alias will work with any valid commit range: -```sh +```shell $ git issues main..HEAD ``` diff --git a/doc/git-l/index.md b/doc/git-l/index.md new file mode 100644 index 00000000..dd73d45d --- /dev/null +++ b/doc/git-l/index.md @@ -0,0 +1,15 @@ +# git l + +## Short for "git log" + +Git alias: + +```git +l = log +``` + +Example: + +```shell +$ git l +``` diff --git a/doc/git-last-tag/index.md b/doc/git-last-tag/index.md new file mode 100644 index 00000000..655b5e7d --- /dev/null +++ b/doc/git-last-tag/index.md @@ -0,0 +1,25 @@ +# git last-tag + +## Show the last tag in the current branch + +Git alias: + +```git +last-tag = describe --tags --abbrev=0 +``` + +Example: + +```shell +$ git last-tag +``` + + +### Documentation for `git describe` + +
+
--tags
+
Instead of using only the annotated tags, use any tag found in refs/tags namespace. This option enables matching a lightweight (non-annotated) tag.
+
--abbrev=<n>
+
Instead of using the default 7 hexadecimal digits as the abbreviated object name, use <n> digits, or as many digits as needed to form a unique object name. An <n> of 0 will suppress long format, only showing the closest tag.
+
diff --git a/doc/git-last-tagged/index.md b/doc/git-last-tagged/index.md new file mode 100644 index 00000000..8cc8ab00 --- /dev/null +++ b/doc/git-last-tagged/index.md @@ -0,0 +1,15 @@ +# git last-tagged + +## Show the last annotated tag in all branches + +Git alias: + +```git +last-tagged = !git describe --tags `git rev-list --tags --max-count=1` +``` + +Example: + +```shell +$ git last-tagged +``` diff --git a/doc/alias/git-lfp/index.md b/doc/git-lfp/index.md similarity index 86% rename from doc/alias/git-lfp/index.md rename to doc/git-lfp/index.md index 575e1223..9c3fd1bf 100644 --- a/doc/alias/git-lfp/index.md +++ b/doc/git-lfp/index.md @@ -2,13 +2,15 @@ ## Log with first parent -```gitconfig +Git alias: + +```git lfp = log --first-parent ``` Example: -```sh +```shell $ git lfp ``` diff --git a/doc/alias/git-lg/index.md b/doc/git-lg/index.md similarity index 82% rename from doc/alias/git-lg/index.md rename to doc/git-lg/index.md index cbe7ec68..ea0f1c9b 100644 --- a/doc/alias/git-lg/index.md +++ b/doc/git-lg/index.md @@ -2,12 +2,14 @@ ## Log with a text-based graphical representation of the commit history -```gitconfig +Git alias: + +```git lg = log --graph ``` Example: -```sh +```shell $ git lg ``` diff --git a/doc/alias/git-ll/index.md b/doc/git-ll/index.md similarity index 87% rename from doc/alias/git-ll/index.md rename to doc/git-ll/index.md index 732804e9..4ff6f5d2 100644 --- a/doc/alias/git-ll/index.md +++ b/doc/git-ll/index.md @@ -1,8 +1,10 @@ # git ll -## Log love - our preferred way key performance indicators. +## Log love - our preferred way key performance indicators -```gitconfig +Git alias: + +```git ll = log \ --graph \ --topo-order \ @@ -16,7 +18,7 @@ ll = log \ Example: -```sh +```shell $ git ll * 2021-01-01 a1b2c3d - Add feature foo [Alice Adams] N … diff --git a/doc/alias/git-lll/index.md b/doc/git-lll/index.md similarity index 89% rename from doc/alias/git-lll/index.md rename to doc/git-lll/index.md index a8f1f3fd..6823b8a6 100644 --- a/doc/alias/git-lll/index.md +++ b/doc/git-lll/index.md @@ -1,8 +1,10 @@ # git lll -## Log love long i.e. our preferred key performance indicators. +## Log love long i.e. our preferred key performance indicators -```gitconfig +Git alias: + +```git lll = log \ --graph \ --topo-order \ @@ -20,7 +22,7 @@ lll = log \ Example: -```sh +```shell $ git lll * 2021-01-01T00:00:00+00:00 remotes/origin/main Add feature foo Alice Adams N … diff --git a/doc/alias/git-lo/index.md b/doc/git-lo/index.md similarity index 75% rename from doc/alias/git-lo/index.md rename to doc/git-lo/index.md index 7754c4e0..f839d97b 100644 --- a/doc/alias/git-lo/index.md +++ b/doc/git-lo/index.md @@ -2,12 +2,14 @@ ## Log with one line per item -```gitconfig +Git alias: + +```git lo = log --oneline ``` Example: -```sh +```shell $ git lo ``` diff --git a/doc/git-log-1-day/index.md b/doc/git-log-1-day/index.md new file mode 100644 index 00000000..2b4df638 --- /dev/null +++ b/doc/git-log-1-day/index.md @@ -0,0 +1,39 @@ +# git log-1-day + +## Show log with the recent day + +Git alias: + +```git +log-1-day = log --since=1-day-ago +``` + +Example: + +```shell +git log-1-day +``` + +## # Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +## # Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-1-hour/index.md b/doc/git-log-1-hour/index.md new file mode 100644 index 00000000..b2806504 --- /dev/null +++ b/doc/git-log-1-hour/index.md @@ -0,0 +1,39 @@ +# git log-1-hour + +## Show log with the recent hour + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +``` + +Example: + +```shell +git log-1-hour +``` + +## # Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +## # Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-1-month/index.md b/doc/git-log-1-month/index.md new file mode 100644 index 00000000..6c98495d --- /dev/null +++ b/doc/git-log-1-month/index.md @@ -0,0 +1,39 @@ +# git log-1-month + +## Show log with the recent month + +Git alias: + +```git +log-1-month = log --since=1-month-ago +``` + +Example: + +```shell +git log-1-month +``` + +### Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +### Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-1-week/index.md b/doc/git-log-1-week/index.md new file mode 100644 index 00000000..8ddbf56e --- /dev/null +++ b/doc/git-log-1-week/index.md @@ -0,0 +1,39 @@ +# git log-1-week + +## Show log with the recent week + +Git alias: + +```git +log-1-week = log --since=1-week-ago +``` + +Example: + +```shell +git log-1-week +``` + +### Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +### Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-1-year/index.md b/doc/git-log-1-year/index.md new file mode 100644 index 00000000..038ee815 --- /dev/null +++ b/doc/git-log-1-year/index.md @@ -0,0 +1,39 @@ +# git log-1-year + +## Show log with the recent year + +Git alias: + +```git +log-1-year = log --since=1-year-ago +``` + +Example: + +```shell +git log-1-year +``` + +## # Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +## # Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-date-first/index.md b/doc/git-log-date-first/index.md new file mode 100644 index 00000000..5b8c5f0b --- /dev/null +++ b/doc/git-log-date-first/index.md @@ -0,0 +1,18 @@ +# git log-date-first + +## Show the date of the earliest commit, in strict ISO 8601 format + +Git alias: + +```git +log-date-first = !"git log --date-order --format=%cI | tail -1" +``` + +Example: + +```shell +$ git log-date-first +``` + +Compare [git log-date-]ast](../git-log-date-last). + diff --git a/doc/git-log-date-last/index.md b/doc/git-log-date-last/index.md new file mode 100644 index 00000000..94397831 --- /dev/null +++ b/doc/git-log-date-last/index.md @@ -0,0 +1,17 @@ +# git log-date-last + +## Show the date of the latest commit, in strict ISO 8601 format + +Git alias: + +```git +log-date-last = !"git log -1 --date-order --format=%cI" +``` + +Example: + +```shell +$ git log-date-last +``` + +Compare [git log-date-first](../git-log-date-first). diff --git a/doc/git-log-fetched/index.md b/doc/git-log-fetched/index.md new file mode 100644 index 00000000..bba0c94b --- /dev/null +++ b/doc/git-log-fetched/index.md @@ -0,0 +1,17 @@ +# git log-fetched + +## Show log of fetched commits vs. origin/main + +Git alias: + +```git +log-fetched = log --oneline HEAD..origin/main +``` + +Example: + +```shell +$ git log-fetched +``` + +TODO: upgrade to make origin variable diff --git a/doc/git-log-fresh/index.md b/doc/git-log-fresh/index.md new file mode 100644 index 00000000..e76c5d28 --- /dev/null +++ b/doc/git-log-fresh/index.md @@ -0,0 +1,15 @@ +# git log-fresh + +## Show log of new commits after you fetched, with stats, excluding merges + +Git alias: + +```git +log-fresh = log ORIG_HEAD.. --stat --no-merges +``` + +Example: + +```shell +$ git log-fresh +``` diff --git a/doc/git-log-graph/index.md b/doc/git-log-graph/index.md new file mode 100644 index 00000000..5e7e26b4 --- /dev/null +++ b/doc/git-log-graph/index.md @@ -0,0 +1,3 @@ +# git log-graph + +TODO diff --git a/doc/git-log-like-long/index.md b/doc/git-log-like-long/index.md new file mode 100644 index 00000000..1cc9d893 --- /dev/null +++ b/doc/git-log-like-long/index.md @@ -0,0 +1,3 @@ +# git log-like-long + +TODO diff --git a/doc/git-log-like/index.md b/doc/git-log-like/index.md new file mode 100644 index 00000000..5cbc10db --- /dev/null +++ b/doc/git-log-like/index.md @@ -0,0 +1,3 @@ +# git log-like + +TODO diff --git a/doc/git-log-my-day/index.md b/doc/git-log-my-day/index.md new file mode 100644 index 00000000..38b24c73 --- /dev/null +++ b/doc/git-log-my-day/index.md @@ -0,0 +1,39 @@ +# git log-my-day + +## Show log with my own recent day + +Git alias: + +```git +log-my-day = log --author $(git config user.email) --since=1-day-ago +``` + +Example: + +```shell +git log-my-day +``` + +### Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +### Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-my-hour/index.md b/doc/git-log-my-hour/index.md new file mode 100644 index 00000000..972ac86c --- /dev/null +++ b/doc/git-log-my-hour/index.md @@ -0,0 +1,39 @@ +# git log-my-hour + +## Show log with my own recent hour + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +``` + +Example: + +```shell +git log-my-hour +``` + +### Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +### Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-my-month/index.md b/doc/git-log-my-month/index.md new file mode 100644 index 00000000..dcf83a17 --- /dev/null +++ b/doc/git-log-my-month/index.md @@ -0,0 +1,39 @@ +# git log-my-month + +## Show log with my own recent month + +Git alias: + +```git +log-my-month = log --author $(git config user.email) --since=1-month-ago +``` + +Example: + +```shell +git log-my-month +``` + +## # Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +## # Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-my-week/index.md b/doc/git-log-my-week/index.md new file mode 100644 index 00000000..6a7b00af --- /dev/null +++ b/doc/git-log-my-week/index.md @@ -0,0 +1,39 @@ +# git log-my-week + +## Show log with my own recent week + +Git alias: + +```git +log-my-week = log --author $(git config user.email) --since=1-week-ago +``` + +Example: + +```shell +git log-my-week +``` + +## # Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +## # Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-my-year/index.md b/doc/git-log-my-year/index.md new file mode 100644 index 00000000..0a122af3 --- /dev/null +++ b/doc/git-log-my-year/index.md @@ -0,0 +1,39 @@ +# git log-my-year + +## Show log with my own recent year + +Git alias: + +```git +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` + +Example: + +```shell +git log-my-year +``` + +### Compare: Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago +``` + +### Compare: Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` diff --git a/doc/git-log-my/index.md b/doc/git-log-my/index.md new file mode 100644 index 00000000..5c377eb4 --- /dev/null +++ b/doc/git-log-my/index.md @@ -0,0 +1,15 @@ +# git log-my + +## Show log for my own commits by my own user email + +Git alias: + +```git +log-my = !git log --author $(git config user.email) +``` + +Example: + +```shell +$ git log-my +``` diff --git a/doc/git-log-of-count-and-day-of-week/index.md b/doc/git-log-of-count-and-day-of-week/index.md new file mode 100644 index 00000000..b9123cce --- /dev/null +++ b/doc/git-log-of-count-and-day-of-week/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-day-of-week + +## Show log with count and day of week + +Git alias: + +```git +git log-of-count-and-day-of-week = … +``` + +Example: + +```shell +$ git log-of-count-and-day-of-week +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-day/index.md b/doc/git-log-of-count-and-day/index.md new file mode 100644 index 00000000..1bf08513 --- /dev/null +++ b/doc/git-log-of-count-and-day/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-day + +## Show log with count and day + +Git alias: + +```git +git log-of-count-and-day = … +``` + +Example: + +```shell +$ git log-of-count-and-day +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-email/index.md b/doc/git-log-of-count-and-email/index.md new file mode 100644 index 00000000..00ad32dc --- /dev/null +++ b/doc/git-log-of-count-and-email/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-email + +## Show log with count and email + +Git alias: + +```git +git log-of-count-and-email = … +``` + +Example: + +```shell +$ git log-of-count-and-email +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-format-with-date/index.md b/doc/git-log-of-count-and-format-with-date/index.md new file mode 100644 index 00000000..6c359ca4 --- /dev/null +++ b/doc/git-log-of-count-and-format-with-date/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-format-with-date + +## Show log with count and custom format string with date + +Git alias: + +```git +git log-of-count-and-format-with-date = … +``` + +Example: + +```shell +$ git log-of-count-and-format-with-date +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-format/index.md b/doc/git-log-of-count-and-format/index.md new file mode 100644 index 00000000..42fde0aa --- /dev/null +++ b/doc/git-log-of-count-and-format/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-format + +## Show a count of log entries and a custom format string + +Git alias: + +```git +log-of-count-and-format = "!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" +``` + +Example: + +```shell +$ git log-of-count-and-format +``` + +Compare [git log-of-format-and-count](../git-log-of-format-and-count). diff --git a/doc/git-log-of-count-and-hour-of-day/index.md b/doc/git-log-of-count-and-hour-of-day/index.md new file mode 100644 index 00000000..c1bb7260 --- /dev/null +++ b/doc/git-log-of-count-and-hour-of-day/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-hour-of-day + +## Show log with count and hour of day + +Git alias: + +```git +git log-of-count-and-hour-of-day = … +``` + +Example: + +```shell +$ git-log-of-count-and-hour-of-day +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-hour/index.md b/doc/git-log-of-count-and-hour/index.md new file mode 100644 index 00000000..bae4d4da --- /dev/null +++ b/doc/git-log-of-count-and-hour/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-hour + +## Show log with count and hour + +Git alias: + +```git +git log-of-count-and-hour = … +``` + +Example: + +```shell +$ git-log-of-count-and-hour +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-month/index.md b/doc/git-log-of-count-and-month/index.md new file mode 100644 index 00000000..b31de717 --- /dev/null +++ b/doc/git-log-of-count-and-month/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-month + +## Show log with count and month + +Git alias: + +```git +git log-of-count-and-month = … +``` + +Example: + +```shell +$ git-log-of-count-and-month +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-week-of-year/index.md b/doc/git-log-of-count-and-week-of-year/index.md new file mode 100644 index 00000000..6ff03cd0 --- /dev/null +++ b/doc/git-log-of-count-and-week-of-year/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-week-of-year + +## Show log with count and week of year + +Git alias: + +```git +git log-of-count-and-week-of-year = … +``` + +Example: + +```shell +$ git-log-of-count-and-week-of-year +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-week/index.md b/doc/git-log-of-count-and-week/index.md new file mode 100644 index 00000000..6150f861 --- /dev/null +++ b/doc/git-log-of-count-and-week/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-week + +## Show log with count and week + +Git alias: + +```git +git log-of-count-and-week = … +``` + +Example: + +```shell +$ git-log-of-count-and-week +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-count-and-year/index.md b/doc/git-log-of-count-and-year/index.md new file mode 100644 index 00000000..d16acd8c --- /dev/null +++ b/doc/git-log-of-count-and-year/index.md @@ -0,0 +1,17 @@ +# git log-of-count-and-year + +## Show log with count and year + +Git alias: + +```git +git log-of-count-and-year = … +``` + +Example: + +```shell +$ git-log-of-count-and-year +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-day-and-count/index.md b/doc/git-log-of-day-and-count/index.md new file mode 100644 index 00000000..4a7e0bcb --- /dev/null +++ b/doc/git-log-of-day-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-day-and-count + +## Show log with day and count + +Git alias: + +```git +git log-of-day-and-count = … +``` + +Example: + +```shell +$ git-log-of-day-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-day-of-week-and-count/index.md b/doc/git-log-of-day-of-week-and-count/index.md new file mode 100644 index 00000000..27bf6b13 --- /dev/null +++ b/doc/git-log-of-day-of-week-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-day-of-week-and-count + +## Show log with day of week and count + +Git alias: + +```git +git log-of-day-of-week-and-count = … +``` + +Example: + +```shell +$ git-log-of-day-of-week-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-email-and-count/index.md b/doc/git-log-of-email-and-count/index.md new file mode 100644 index 00000000..4f2c0e29 --- /dev/null +++ b/doc/git-log-of-email-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-email-and-count + +## Show log with email and count + +Git alias: + +```git +git log-of-email-and-count = … +``` + +Example: + +```shell +$ git-log-of-email-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-format-and-count-with-date/index.md b/doc/git-log-of-format-and-count-with-date/index.md new file mode 100644 index 00000000..44c6c9a7 --- /dev/null +++ b/doc/git-log-of-format-and-count-with-date/index.md @@ -0,0 +1,17 @@ +# git log-of-format-and-count-with-date + +## Show log with a custom format string and a count and a date + +Git alias: + +```git +git log-of-format-and-count-with-date = … +``` + +Example: + +```shell +$ git-log-of-format-and-count-with-date +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-format-and-count/index.md b/doc/git-log-of-format-and-count/index.md new file mode 100644 index 00000000..2d8b5123 --- /dev/null +++ b/doc/git-log-of-format-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-format-and-count + +## Show log with a custom format string and count + +Git alias: + +```git +log-of-format-and-count = "!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" +``` + +Example: + +```shell +$ git log-of-format-and-count +``` + +Compare [git log-of-count-and-format](../git-log-of-count-and-format). diff --git a/doc/git-log-of-hour-and-count/index.md b/doc/git-log-of-hour-and-count/index.md new file mode 100644 index 00000000..5730ae4c --- /dev/null +++ b/doc/git-log-of-hour-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-hour-and-count + +## Show log with hour and count + +Git alias: + +```git +git log-of-hour-and-count = … +``` + +Example: + +```shell +$ git-log-of-hour-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-hour-of-day-and-count/index.md b/doc/git-log-of-hour-of-day-and-count/index.md new file mode 100644 index 00000000..0de89a3e --- /dev/null +++ b/doc/git-log-of-hour-of-day-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-hour-of-day-and-count + +## Show log with hour of day and count + +Git alias: + +```git +git log-of-hour-of-day-and-count = … +``` + +Example: + +```shell +$ git-log-of-hour-of-day-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-month-and-count/index.md b/doc/git-log-of-month-and-count/index.md new file mode 100644 index 00000000..832d7b44 --- /dev/null +++ b/doc/git-log-of-month-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-month-and-count + +## Show log with month and count + +Git alias: + +```git +git log-of-month-and-count = … +``` + +Example: + +```shell +$ git-log-of-month-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-week-and-count/index.md b/doc/git-log-of-week-and-count/index.md new file mode 100644 index 00000000..b2d68d7b --- /dev/null +++ b/doc/git-log-of-week-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-week-and-count + +## Show log with week and count + +Git alias: + +```git +git log-of-week-and-count = … +``` + +Example: + +```shell +$ git-log-of-week-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-week-of-year-and-count/index.md b/doc/git-log-of-week-of-year-and-count/index.md new file mode 100644 index 00000000..1928aab8 --- /dev/null +++ b/doc/git-log-of-week-of-year-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-week-of-year-and-count + +## Show log with week of year and count + +Git alias: + +```git +git log-of-week-of-year-and-count = … +``` + +Example: + +```shell +$ git-log-of-week-of-year-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/git-log-of-year-and-count/index.md b/doc/git-log-of-year-and-count/index.md new file mode 100644 index 00000000..b940d889 --- /dev/null +++ b/doc/git-log-of-year-and-count/index.md @@ -0,0 +1,17 @@ +# git log-of-year-and-count + +## Show log with year and count + +Git alias: + +```git +git log-of-year-and-count = … +``` + +Example: + +```shell +$ git-log-of-year-and-count +``` + +Compare [git log-of-*](../git-log-of) diff --git a/doc/alias/git-log/index.md b/doc/git-log-of/index.md similarity index 52% rename from doc/alias/git-log/index.md rename to doc/git-log-of/index.md index b8630762..13b2698a 100644 --- a/doc/alias/git-log/index.md +++ b/doc/git-log-of/index.md @@ -1,157 +1,212 @@ -# git log +# git log-of-* -## Log helpers +## Show log entries using a count and a custom format string -```gitconfig -# Show log of changes, most recent first -log-changes = log --oneline --reverse -# Show log of new commits after you fetched, with stats, excluding merges -log-fresh = log ORIG_HEAD.. --stat --no-merges +## # Show a specific format string and its number of log entries -# Show log in our preferred format for our key performance indicators. A.k.a. `ll`. -log-like = log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset' +Git alias: -# Show log in our preferred format for our key performance indicators, with long items. A.k.a. `lll`. -log-like-long = log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset' - -# Show log with dates in our local timezone -log-local = log --date=local +```git +log-of-format-and-count = "!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" -# Show the log for my own commits by my own user email -log-my = !git log --author $(git config user.email) +log-of-count-and-format = "!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" +``` -# Show log as a graph -log-graph = log --graph --all --oneline --decorate +Example: -# Show the date of the earliest commit, in strict ISO 8601 format -log-first-date = !"git log --date-order --format=%cI | tail -1" +```shell +$ git log-of-format-and-count -# Show the date of the latest commit, in strict ISO 8601 format -log-latest-date = log -1 --date-order --format=%cI +$ git log-of-count-and-format +``` -# Show the log of the recent hour, day, week, month, year -log-hour = log --since=1-hour-ago -log-day = log --since=1-day-ago -log-week = log --since=1-week-ago -log-month = log --since=1-month-ago -log-year = log --since=1-year-ago -# Show the log of my own recent hour, day, week, month, year -log-my-hour = log --author $(git config user.email) --since=1-hour-ago -log-my-day = log --author $(git config user.email) --since=1-day-ago -log-my-week = log --author $(git config user.email) --since=1-week-ago -log-my-month = log --author $(git config user.email) --since=1-month-ago -log-my-year = log --author $(git config user.email) --since=1-year-ago +## # Show the number of log entries by a specific format string and date format string -# Show a specific format string and its number of log entries -log-of-format-and-count = "!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" -log-of-count-and-format = "!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" +Git alias: -# Show the number of log entries by a specific format string and date format string +```git log-of-format-and-count-with-date = "!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" + log-of-count-and-format-with-date = "!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" +``` + +Example: + +```shell +$ git log-of-format-and-count-with-date + +$ git log-of-count-and-format-with-date +``` -# Show the number of log items by email + +## # Show the number of log items by email + +Git alias: + +```git log-of-email-and-count = "!f() { git log-of-format-and-count \"%aE\" $@; }; f" + log-of-count-and-email = "!f() { git log-of-count-and-format \"%aE\" $@; }; f" +``` + +Example: + +```shell +$ git log-of-email-and-count -# Show the number of log items by hour +$ git log-of-count-and-email +``` + + +## # Show the number of log items by hour + +Git alias: + +```git log-of-hour-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m-%dT%H\" $@ ; }; f" + log-of-count-and-hour = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m-%dT%H\" $@ ; }; f" +``` -# Show the number of log items by day -log-of-day-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m-%d\" $@ ; }; f" -log-of-count-and-day = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m-%d\" $@ ; }; f" +Example: -# Show the number of log items by week -log-of-week-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y#%V\" $@; }; f" -log-of-count-and-week = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y#%V\" $@; }; f" +```shell +$ git log-of-hour-and-count -# Show the number of log items by month -log-of-month-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m\" $@ ; }; f" -log-of-count-and-month = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m\" $@ ; }; f" +$ git log-of-count-and-hour +``` -# Show the number of log items by year -log-of-year-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y\" $@ ; }; f" -log-of-count-and-year = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y\" $@ ; }; f" -# Show the number of log items by hour of day -log-of-hour-of-day-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%H\" $@; }; f" -log-of-count-and-hour-of-day = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%H\" $@; }; f" +## # Show the number of log items by day -# Show the number of log items by day of week -log-of-day-of-week-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%u\" $@; }; f" -log-of-count-and-day-of-week = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%u\" $@; }; f" +Git alias: -# Show the number of log items by week of year -log-of-week-of-year-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%V\" $@; }; f" -log-of-count-and-week-of-year = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%V\" $@; }; f" +```git +log-of-day-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m-%d\" $@ ; }; f" -# TODO -log-refs = log --all --graph --decorate --oneline --simplify-by-decoration --no-merges -log-timeline = log --format='%h %an %ar - %s' -log-local = log --oneline origin..HEAD -log-fetched = log --oneline HEAD..origin/main +log-of-count-and-day = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m-%d\" $@ ; }; f" ``` Example: -```sh -$ git log-changes -$ git log-fresh -$ git log-like -$ git log-like-long -$ git log-local -$ git log-my -$ git log-graph -$ git log-first-date -$ git log-latest-date = log -1 --date-order --format=%cI - -$ git log-hour -$ git log-day -$ git log-week -$ git log-month -$ git log-year - -$ git log-my-hour -$ git log-my-day -$ git log-my-week -$ git log-my-month -$ git log-my-year +```shell +$ git log-of-day-and-count -$ git log-of-format-and-count -$ git log-of-format-and-count-with-date +$ git log-of-count-and-day +``` -$ git log-of-email-and-count -$ git log-of-count-and-email -$ git log-of-hour-and-count -$ git log-of-count-and-hour +## # Show the number of log items by week -$ git log-of-day-and-count -$ git log-of-count-and-day +Git alias: + +```git +log-of-week-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y#%V\" $@; }; f" +log-of-count-and-week = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y#%V\" $@; }; f" +``` + +Example: + +```shell $ git log-of-week-and-count + $ git log-of-count-and-week +``` + + +## # Show the number of log items by month + +Git alias: + +```git +log-of-month-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y-%m\" $@ ; }; f" + +log-of-count-and-month = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y-%m\" $@ ; }; f" +``` + +Example: +```shell $ git log-of-month-and-count + $ git log-of-count-and-month +``` + + +## # Show the number of log items by year + +Git alias: +```git +log-of-year-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%Y\" $@ ; }; f" + +log-of-count-and-year = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%Y\" $@ ; }; f" +``` + +Example: + +```shell $ git log-of-year-and-count + $ git log-of-count-and-year +``` + + +## # Show the number of log items by hour of day + +Git alias: +```git +log-of-hour-of-day-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%H\" $@; }; f" + +log-of-count-and-hour-of-day = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%H\" $@; }; f" +``` + +Example: + +```shell $ git log-of-hour-of-day-and-count + $ git log-of-count-and-hour-of-day +``` + + +## # Show the number of log items by day of week + +Git alias: + +```git +log-of-day-of-week-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%u\" $@; }; f" + +log-of-count-and-day-of-week = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%u\" $@; }; f" +``` +Example: + +```shell $ git log-of-day-of-week-and-count + $ git log-of-count-and-day-of-week +``` + + +## # Show the number of log items by week of year + +Git alias: + +```git +log-of-week-of-year-and-count = "!f() { git log-of-format-and-count-with-date \"%ad\" \"%V\" $@; }; f" + +log-of-count-and-week-of-year = "!f() { git log-of-count-and-format-with-date \"%ad\" \"%V\" $@; }; f" +``` +Example: + +```shell $ git log-of-week-of-year-and-count -$ git log-of-count-and-week-of-year -$ git log-refs -$ git log-timeline -$ git log-local -$ git log-fetched +$ git log-of-count-and-week-of-year ``` diff --git a/doc/git-log-refs/index.md b/doc/git-log-refs/index.md new file mode 100644 index 00000000..30d90bb4 --- /dev/null +++ b/doc/git-log-refs/index.md @@ -0,0 +1,15 @@ +# git log-refs + +## Show log with commits that are referred by some branch or tag + +Git alias: + +```git +log-refs = log --all --graph --decorate --oneline --simplify-by-decoration --no-merges +``` + +Example: + +```shell +$ git log-refs +``` diff --git a/doc/git-log-timeline/index.md b/doc/git-log-timeline/index.md new file mode 100644 index 00000000..32561f75 --- /dev/null +++ b/doc/git-log-timeline/index.md @@ -0,0 +1,3 @@ +# git log-timeline + +TODO diff --git a/doc/git-log/index.md b/doc/git-log/index.md new file mode 100644 index 00000000..f48c87ca --- /dev/null +++ b/doc/git-log/index.md @@ -0,0 +1,82 @@ +# git log + +## Log helpers + +Git alias: + +```git +# Show log in our preferred format for our key performance indicators. A.k.a. `ll`. +log-like = log --graph --topo-order --date=short --abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn]%Creset %Cblue%G?%Creset' + +# Show log in our preferred format for our key performance indicators, with long items. A.k.a. `lll`. +log-like-long = log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset' + +# Show log with dates in our local timezone +log-local = log --date=local + +# Show log as a graph +log-graph = log --graph --all --oneline --decorate + +# TODO +log-refs = log --all --graph --decorate --oneline --simplify-by-decoration --no-merges +log-timeline = log --format='%h %an %ar - %s' +log-local = log --oneline origin..HEAD +log-fetched = log --oneline HEAD..origin/main +``` + +Example: + +```shell +$ git log-like +$ git log-like-long +$ git log-local +$ git log-graph +$ git log-refs +$ git log-timeline +$ git log-local +$ git log-fetched +``` + + +### Show log with the recent hour, day, week, month, year + +Git alias: + +```git +log-1-hour = log --since=1-hour-ago +log-1-day = log --since=1-day-ago +log-1-week = log --since=1-week-ago +log-1-month = log --since=1-month-ago +log-1-year = log --since=1-year-ago + +Example: + +```shell +$ git log-1-hour +$ git log-1-day +$ git log-1-week +$ git log-1-month +$ git log-1-year +``` + +### Show log with my own recent hour, day, week, month, year + +Git alias: + +```git +log-my-hour = log --author $(git config user.email) --since=1-hour-ago +log-my-day = log --author $(git config user.email) --since=1-day-ago +log-my-week = log --author $(git config user.email) --since=1-week-ago +log-my-month = log --author $(git config user.email) --since=1-month-ago +log-my-year = log --author $(git config user.email) --since=1-year-ago +``` + +Example: + +```shell +$ git log-my-hour +$ git log-my-day +$ git log-my-week +$ git log-my-month +$ git log-my-year +``` diff --git a/doc/git-lor/index.md b/doc/git-lor/index.md new file mode 100644 index 00000000..3d3768a8 --- /dev/null +++ b/doc/git-lor/index.md @@ -0,0 +1,15 @@ +# git lor + +## Log with one line per item, in reverse order i.e. recent items first + +Git alias: + +```git +lor = log --oneline --reverse +``` + +Example: + +```shell +$ git lor +``` diff --git a/doc/alias/git-lp/index.md b/doc/git-lp/index.md similarity index 75% rename from doc/alias/git-lp/index.md rename to doc/git-lp/index.md index d345f984..42ce4dd2 100644 --- a/doc/alias/git-lp/index.md +++ b/doc/git-lp/index.md @@ -2,12 +2,14 @@ ## Log with patch generation -```gitconfig +Git alias: + +```git lp = log --patch ``` Example: -```sh +```shell $ git lp ``` diff --git a/doc/alias/git-ls/index.md b/doc/git-ls/index.md similarity index 81% rename from doc/alias/git-ls/index.md rename to doc/git-ls/index.md index dd45e6a7..04b4bf26 100644 --- a/doc/alias/git-ls/index.md +++ b/doc/git-ls/index.md @@ -2,12 +2,14 @@ ## List files in the index and the working tree; like Unix "ls" command -```gitconfig +Git alias: + +```git ls = ls-files ``` Example: -```sh +```shell $ git ls ``` diff --git a/doc/alias/git-lsd/index.md b/doc/git-lsd/index.md similarity index 78% rename from doc/alias/git-lsd/index.md rename to doc/git-lsd/index.md index 9fd7689f..8032960a 100644 --- a/doc/alias/git-lsd/index.md +++ b/doc/git-lsd/index.md @@ -2,12 +2,14 @@ ## List files and show debug information -```gitconfig +Git alias: + +```git lsd = ls-files --debug ``` Example: -```sh +```shell $ git lsd ``` diff --git a/doc/alias/git-lsfn/index.md b/doc/git-lsfn/index.md similarity index 78% rename from doc/alias/git-lsfn/index.md rename to doc/git-lsfn/index.md index 6eec6c43..d006ec09 100644 --- a/doc/alias/git-lsfn/index.md +++ b/doc/git-lsfn/index.md @@ -2,12 +2,14 @@ ## List files and show full name -```gitconfig +Git alias: + +```git lsfn = ls-files --full-name ``` Example: -```sh +```shell $ git lsfn ``` diff --git a/doc/alias/git-lsio/index.md b/doc/git-lsio/index.md similarity index 93% rename from doc/alias/git-lsio/index.md rename to doc/git-lsio/index.md index 4ac3f35a..b16d656f 100644 --- a/doc/alias/git-lsio/index.md +++ b/doc/git-lsio/index.md @@ -2,13 +2,15 @@ ## List files that git is ignoring -```gitconfig +Git alias: + +```git lsio = ls-files --ignored --others --exclude-standard ``` Example: -```sh +```shell $ git lsio ``` diff --git a/doc/alias/git-lto/index.md b/doc/git-lto/index.md similarity index 88% rename from doc/alias/git-lto/index.md rename to doc/git-lto/index.md index cd941e40..84938aac 100644 --- a/doc/alias/git-lto/index.md +++ b/doc/git-lto/index.md @@ -2,14 +2,16 @@ ## Log with items appearing in topological order -```gitconfig +Git alias: + +```git # git lto: lto = log --topo-order ``` Example: -```sh +```shell $ git lto ``` diff --git a/doc/git-m/index.md b/doc/git-m/index.md new file mode 100644 index 00000000..fc787dfd --- /dev/null +++ b/doc/git-m/index.md @@ -0,0 +1,15 @@ +# git m + +## Short for "git merge" + +Git alias: + +```git +m = merge +``` + +Example: + +```shell +$ git m +``` diff --git a/doc/alias/git-ma/index.md b/doc/git-ma/index.md similarity index 78% rename from doc/alias/git-ma/index.md rename to doc/git-ma/index.md index 22d4821f..c4cd5cf2 100644 --- a/doc/alias/git-ma/index.md +++ b/doc/git-ma/index.md @@ -2,12 +2,14 @@ ## Merge abort i.e. abort the merge process -```gitconfig +Git alias: + +```git ma = merge --abort ``` Example: -```sh +```shell $ git ma ``` diff --git a/doc/git-mainly/index.md b/doc/git-mainly/index.md new file mode 100644 index 00000000..60fa0f37 --- /dev/null +++ b/doc/git-mainly/index.md @@ -0,0 +1,20 @@ +# git mainly + +## Make local like main + + +Git alias: + +```git +mainly = !git checkout main && git fetch origin --prune && git reset --hard origin/main +``` + +Example: + +```shell +$ git mainly +``` + +Do everything we can to make the local repo like the main branch. + +TODO: handle tags, and delete superfluous branches, and add error handling. diff --git a/doc/alias/git-mc/index.md b/doc/git-mc/index.md similarity index 79% rename from doc/alias/git-mc/index.md rename to doc/git-mc/index.md index aa886f39..7371a9e8 100644 --- a/doc/alias/git-mc/index.md +++ b/doc/git-mc/index.md @@ -2,12 +2,14 @@ ## Merge continue i.e. continue the merge process -```gitconfig +Git alias: + +```git mc = merge --continue ``` Example: -```sh +```shell $ git mc ``` diff --git a/doc/alias/git-merge-safe/index.md b/doc/git-merge-safe/index.md similarity index 96% rename from doc/alias/git-merge-safe/index.md rename to doc/git-merge-safe/index.md index 3c1c0f5e..4c7c0120 100644 --- a/doc/alias/git-merge-safe/index.md +++ b/doc/git-merge-safe/index.md @@ -2,13 +2,15 @@ ## Join two or more development histories together safely -```gitconfig +Git alias: + +```git merge-safe = merge --no-commit --no-ff ``` Example: -```sh +```shell $ git merge-safe ``` diff --git a/doc/git-merge-span-diff/index.md b/doc/git-merge-span-diff/index.md new file mode 100644 index 00000000..c503137b --- /dev/null +++ b/doc/git-merge-span-diff/index.md @@ -0,0 +1,20 @@ +# git merge-span-diff + +## Show the changes that were introduced by a merge + +```gitalias +merge-span-diff = !"git diff `git merge-span ... $1`" +``` + +Example: + +```shell +$ git merge-span-diff +``` + +Compare: + +* [git merge-span](../git-merge-span) (summary) +* [git merge-span-log](../git-merge-span-log) +* [git merge-span-diff](../git-merge-span-diff) (this alias) +* [git merge-span-difftool](../git-merge-span-difftool) diff --git a/doc/git-merge-span-difftool/index.md b/doc/git-merge-span-difftool/index.md new file mode 100644 index 00000000..7dd0d635 --- /dev/null +++ b/doc/git-merge-span-difftool/index.md @@ -0,0 +1,20 @@ +# git merge-span-difftool + +## Show the changes that were introduced by a merge, in your difftool + +```gitalias +merge-span-difftool = !"git difftool `git merge-span ... $1`" +``` + +Example: + +```shell +$ git merge-span-difftool +``` + +Compare: + +* [git merge-span](../git-merge-span) (summary) +* [git merge-span-log](../git-merge-span-log) +* [git merge-span-diff](../git-merge-span-diff) +* [git merge-span-difftool](../git-merge-span-difftool) (this alias) diff --git a/doc/git-merge-span-log/index.md b/doc/git-merge-span-log/index.md new file mode 100644 index 00000000..56222e1f --- /dev/null +++ b/doc/git-merge-span-log/index.md @@ -0,0 +1,22 @@ +# git merge-span-log + +## Find the commits that were introduced by a merge + +Git alias: + +```git +merge-span-log = "!git log `git merge-span .. $1`" +``` + +Example: + +```shell +$ git merge-span-log +``` + +Compare: + +* [git merge-span](../git-merge-span) (summary) +* [git merge-span-log](../git-merge-span-log) (this alias) +* [git merge-span-diff](../git-merge-span-diff) +* [git merge-span-difftool](../git-merge-span-difftool) diff --git a/doc/alias/git-merge-span/index.md b/doc/git-merge-span/index.md similarity index 76% rename from doc/alias/git-merge-span/index.md rename to doc/git-merge-span/index.md index 5b6ef5a3..47189602 100644 --- a/doc/alias/git-merge-span/index.md +++ b/doc/git-merge-span/index.md @@ -1,8 +1,10 @@ -# git merge-span-* +# git merge-span ## Merge span aliases -```gitconfig +Git alias: + +```git # Given a merge commit, find the span of commits that exist(ed). # Not so useful in itself, but used by other aliases. # Thanks to Rob Miller for the merge-span-* aliases. @@ -23,9 +25,16 @@ merge-span-difftool = !"git difftool `git merge-span ... $1`" Example: -```sh +```shell $ git merge-span $ git merge-span-log $ git merge-span-diff $ git merge-span-difftool ``` + +Compare: + +* [git merge-span](../git-merge-span) (this page) +* [git merge-span-log](../git-merge-span-log) +* [git merge-span-diff](../git-merge-span-diff) +* [git merge-span-difftool](../git-merge-span-difftool) diff --git a/doc/git-mncnf/index.md b/doc/git-mncnf/index.md new file mode 100644 index 00000000..6a796d9c --- /dev/null +++ b/doc/git-mncnf/index.md @@ -0,0 +1,17 @@ +# git mncnf + +## Merge with no autocommit, and with no fast-forward + +Git alias: + +```git +mncnf = merge --no-commit --no-ff +``` + +Example: + +```shell +$ git mncnf +``` + +This does a merge, but without autocommit, and with a commit even if the merge resolves as a fast-forward. diff --git a/doc/alias/git-move-alias/index.md b/doc/git-move-alias/index.md similarity index 97% rename from doc/alias/git-move-alias/index.md rename to doc/git-move-alias/index.md index 56bc58bf..aab9e631 100644 --- a/doc/alias/git-move-alias/index.md +++ b/doc/git-move-alias/index.md @@ -2,7 +2,9 @@ ## Rename an existing git alias -```gitconfig +Git alias: + +```git move-alias = "!f() { \ if [ $# != 3 ]; then \ echo \"Usage: git move-alias ( --local | --global ) \"; \ @@ -32,7 +34,7 @@ move-alias = "!f() { \ Example: -```sh +```shell $ git move-alias --local foo bar $ git move-alias --global foo bar ``` diff --git a/doc/git-my-branch/index.md b/doc/git-my-branch/index.md new file mode 100644 index 00000000..b39d74ff --- /dev/null +++ b/doc/git-my-branch/index.md @@ -0,0 +1,22 @@ +# git my-branch + +## Get my current local branch name + +Git alias: + +```git +my-branch = rev-parse --abbrev-ref HEAD +``` + +Example: + +```shell +$ git my-branch +main +``` + +Compare: + +* [git my-branch](../git-my-branch) - Get my current local branch name (this alias) + +* [git upstream-branch](../git-upstream-branch) - Get the upstream branch name diff --git a/doc/git-o/index.md b/doc/git-o/index.md new file mode 100644 index 00000000..a75c937f --- /dev/null +++ b/doc/git-o/index.md @@ -0,0 +1,15 @@ +# git o + +## Short for "git checkout" + +Git alias: + +```git +o = checkout +``` + +Example: + +```shell +$ git o +``` diff --git a/doc/alias/git-optimizer/index.md b/doc/git-optimizer/index.md similarity index 84% rename from doc/alias/git-optimizer/index.md rename to doc/git-optimizer/index.md index 66fa3aa3..65e99860 100644 --- a/doc/alias/git-optimizer/index.md +++ b/doc/git-optimizer/index.md @@ -1,14 +1,16 @@ # git optimizer -## Optimize the repository +## Optimize the repository by pruning and repacking -```gitconfig +Git alias: + +```git optimizer = !git pruner; git repacker; git prune-packed ``` Example: -```sh +```shell $ git optimizer ``` diff --git a/doc/alias/git-orphans/index.md b/doc/git-orphans/index.md similarity index 88% rename from doc/alias/git-orphans/index.md rename to doc/git-orphans/index.md index d704db8a..05cd6b88 100644 --- a/doc/alias/git-orphans/index.md +++ b/doc/git-orphans/index.md @@ -2,20 +2,22 @@ ## Find all objects that aren't referenced by any other object -```gitconfig +Git alias: + +```git orphans = fsck --full ``` Example: -```sh +```shell $ git orphans ``` To help an orphan, we can create a new branch with the orphan's commit hash, then merge it into our current branch: -```sh +```shell $ git branch foo $ git merge foo ``` diff --git a/doc/alias/git-ours-git-theirs/index.md b/doc/git-ours-git-theirs/index.md similarity index 71% rename from doc/alias/git-ours-git-theirs/index.md rename to doc/git-ours-git-theirs/index.md index 6a153188..2930eb75 100644 --- a/doc/alias/git-ours-git-theirs/index.md +++ b/doc/git-ours-git-theirs/index.md @@ -2,14 +2,16 @@ ## Easy merging when you know which files you want -```gitconfig +Git alias: + +```git ours = !"f() { git checkout --ours $@ && git add $@; }; f" theirs = !"f() { git checkout --theirs $@ && git add $@; }; f" ``` Example: -```sh +```shell $ git ours $ git theirs ``` @@ -19,6 +21,8 @@ Sometimes during a merge you want to take a file from one side wholesale. The following aliases expose the "ours" and "theirs" options which let you pick a file(s) from the current branch or the merged branch respectively. - * ours: checkout our version of a file and add it +Compare: + +* [git ours](../git-ours) - Checkout our version of a file and add it - * theirs: checkout their version of a file and add it +* [git theirs](../git-theirs) - Checkout their version of a file and add it diff --git a/doc/git-ours/index.md b/doc/git-ours/index.md new file mode 100644 index 00000000..50155a5f --- /dev/null +++ b/doc/git-ours/index.md @@ -0,0 +1,23 @@ +# git ours + +## Checkout our version of a file and add it + +Git alias: + +```git +ours = !"f() { git checkout --ours $@ && git add $@; }; f" +``` + +Example: + +```shell +$ git ours +``` + +Compare: + +* [git ours & git theirs](../git-ours-git-theirs) (describes both) + +* [git ours](../git-ours) (this alias) + +* [git theirs](../git-theirs) diff --git a/doc/alias/git-outbound/index.md b/doc/git-outbound/index.md similarity index 70% rename from doc/alias/git-outbound/index.md rename to doc/git-outbound/index.md index 8c0e4e53..8861644f 100644 --- a/doc/alias/git-outbound/index.md +++ b/doc/git-outbound/index.md @@ -1,13 +1,17 @@ # git outbound -```gitconfig +## Show outgoing changes compared to upstream + +Git alias: + +```git # git outbound - Show outgoing changes compared to upstream. outbound = log @{upstream}.. ``` Example: -```sh +```shell $ git outbound ``` diff --git a/doc/git-p/index.md b/doc/git-p/index.md new file mode 100644 index 00000000..3ad10330 --- /dev/null +++ b/doc/git-p/index.md @@ -0,0 +1,15 @@ +# git p + +## Short for "git pull" + +Git alias: + +```git +p = pull +``` + +Example: + +```shell +$ git p +``` diff --git a/doc/alias/git-panic/index.md b/doc/git-panic/index.md similarity index 87% rename from doc/alias/git-panic/index.md rename to doc/git-panic/index.md index 933d1602..ba9ded49 100644 --- a/doc/alias/git-panic/index.md +++ b/doc/git-panic/index.md @@ -2,13 +2,15 @@ ## When you're a little worried that the world is coming to an end -```gitconfig +Git alias: + +```git panic = !tar cvf ../panic.tar * ``` Example: -```sh +```shell $ git panic ``` diff --git a/doc/alias/git-pf/index.md b/doc/git-pf/index.md similarity index 80% rename from doc/alias/git-pf/index.md rename to doc/git-pf/index.md index 0f548c1e..4d499bc5 100644 --- a/doc/alias/git-pf/index.md +++ b/doc/git-pf/index.md @@ -1,14 +1,16 @@ # git pf -## Pull if a merge can be resolved as a fast-forward, otherwise fail. +## Pull if a merge can be resolved as a fast-forward, otherwise fail -```gitconfig +Git alias: + +```git # git pf: pf = pull --ff-only ``` Example: -```sh +```shell $ git pf ``` diff --git a/doc/alias/git-pp/index.md b/doc/git-pp/index.md similarity index 98% rename from doc/alias/git-pp/index.md rename to doc/git-pp/index.md index b44d84fc..dcf2bdc6 100644 --- a/doc/alias/git-pp/index.md +++ b/doc/git-pp/index.md @@ -2,13 +2,15 @@ ## Pull with rebase preserve of merge commits -```gitconfig +Git alias: + +```git pp = pull --rebase=preserve ``` Example: -```sh +```shell $ git pp ``` diff --git a/doc/alias/git-pr/index.md b/doc/git-pr/index.md similarity index 94% rename from doc/alias/git-pr/index.md rename to doc/git-pr/index.md index 303e592c..d6238cab 100644 --- a/doc/alias/git-pr/index.md +++ b/doc/git-pr/index.md @@ -2,33 +2,35 @@ ## Pull with rebase i.e. provide a cleaner, linear, bisectable history -```gitconfig +Git alias: + +```git pr = pull --rebase ``` Example: -```sh +```shell $ git pr ``` To automatically do "pull --rebase" everywhere: -```sh +```shell $ git config --global pull.rebase true ``` To automatically do "pull --rebase" for any branch based on the branch "main": -```sh +```shell $ git config branch.main.rebase true ``` To automatically do "pull --rebase" for any newly-created branches: -```sh +```shell $ git config --global branch.autosetuprebase always ``` @@ -40,7 +42,7 @@ If we've made changes locally and someone else has pushed changes to our git host then git will automatically merge these together and create a merge commit that looks like this in the history: -```sh +```shell 12345678 - Merge branch 'foo' of bar into main ``` diff --git a/doc/alias/git-pruner/index.md b/doc/git-pruner/index.md similarity index 92% rename from doc/alias/git-pruner/index.md rename to doc/git-pruner/index.md index e4162a6a..1df1c139 100644 --- a/doc/alias/git-pruner/index.md +++ b/doc/git-pruner/index.md @@ -2,13 +2,15 @@ ## Prune everything that is unreachable now -```gitconfig +Git alias: + +```git pruner = !"git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all" ``` Example: -```sh +```shell $ git pruner ``` diff --git a/doc/git-publish-git-unpublish/index.html b/doc/git-publish-git-unpublish/index.html new file mode 100644 index 00000000..828b4e48 --- /dev/null +++ b/doc/git-publish-git-unpublish/index.html @@ -0,0 +1,181 @@ + + + + + + git publish & git unpublish - GitAlias + + + + + + + + + + + + + + +
+
+

git publish & git unpublish

+

Publish/unpublish the current branch

+

Compare:

+ + +
+
+ +
+
+ +
+ GitAlias.com +
+
+
+ + + diff --git a/doc/git-publish-git-unpublish/index.md b/doc/git-publish-git-unpublish/index.md new file mode 100644 index 00000000..39f5f13c --- /dev/null +++ b/doc/git-publish-git-unpublish/index.md @@ -0,0 +1,9 @@ +# git publish & git unpublish + +## Publish/unpublish the current branch + +Compare: + +* [git publish](../git-publish) + +* [git unpublish](../git-unpublish) diff --git a/doc/git-publish/index.md b/doc/git-publish/index.md new file mode 100644 index 00000000..57fd143d --- /dev/null +++ b/doc/git-publish/index.md @@ -0,0 +1,26 @@ +# git publish + +## Publish the current branch + +Git alias: + +```git +publish = !"git push --set-upstream origin $(git my-branch)" +``` + +Publish the current branch by pushing upstream to origin, +and setting the current branch to track the upstream branch. + +Example: + +```shell +$ git publish +``` + +Compare: + +* [git publish & git unpublish](../git-publish-git-unpublish) (describes both) + +* [git publish](../git-publish) (this alias) + +* [git unpublish](../git-unpublish) diff --git a/doc/git-pull1/index.md b/doc/git-pull1/index.md new file mode 100644 index 00000000..ae2b5861 --- /dev/null +++ b/doc/git-pull1/index.md @@ -0,0 +1,17 @@ +# git pull1 + +## Pull just the one current branch + +Git alias: + +```git +pull1 = "!git pull origin $(git my-branch)" +``` + +Example: + +```shell +$ git pull1 +``` + +Compare [git push1](../git-push1). diff --git a/doc/git-push1/index.md b/doc/git-push1/index.md new file mode 100644 index 00000000..cb08b317 --- /dev/null +++ b/doc/git-push1/index.md @@ -0,0 +1,17 @@ +# git push1 + +## Push just the one current branch + +Git alias: + +```git +push1 = "!git push origin $(git my-branch)" +``` + +Example: + +```shell +$ git push1 +``` + +Compare [git pull1](../git-pull1). diff --git a/doc/git-pushy/index.md b/doc/git-pushy/index.md new file mode 100644 index 00000000..dcd2738c --- /dev/null +++ b/doc/git-pushy/index.md @@ -0,0 +1,22 @@ +# git pushy + +## Push with force and lease + +Git alias: + +```git +pushy = !git push --force-with-lease +``` + +Push with force and lease, which means that you're pushing in order +to forcefully overwrite the remote, and you want a safety check first: +git checks you're current with remote, and only then allows the push. + +We name this `pushy` because its dsagreeably aggressive (in general) +or overly assertive (in general), yet still better than just --force. + +Example: + +````shell +$ git pushy +``` diff --git a/doc/git-put/index.md b/doc/git-put/index.md new file mode 100644 index 00000000..e5fffcc9 --- /dev/null +++ b/doc/git-put/index.md @@ -0,0 +1,23 @@ +# git put + +## Put all changes for the current branch + +Git alias: + +```git +put = !git commit --all && git push +``` + +Example: + +```shell +$ git put +``` + +Compare: + +* [git get & git put](../git-get-git-put) (describes both) + +* [git get](../git-get) + +* [git put](../git-put) (this alias) diff --git a/doc/git-rb/index.md b/doc/git-rb/index.md new file mode 100644 index 00000000..051d45c4 --- /dev/null +++ b/doc/git-rb/index.md @@ -0,0 +1,15 @@ +# git rb + +## Short for "git rebase" + +Git alias: + +```git +rb = rebase +``` + +Example: + +```shell +$ git rb +``` diff --git a/doc/alias/git-rba/index.md b/doc/git-rba/index.md similarity index 79% rename from doc/alias/git-rba/index.md rename to doc/git-rba/index.md index 3d317b69..12e10300 100644 --- a/doc/alias/git-rba/index.md +++ b/doc/git-rba/index.md @@ -2,12 +2,14 @@ ## Rebase abort i.e. abort the rebase process -```gitconfig +Git alias: + +```git rba = rebase --abort ``` Example: -```sh +```shell $ git rba ``` diff --git a/doc/alias/git-rbc/index.md b/doc/git-rbc/index.md similarity index 88% rename from doc/alias/git-rbc/index.md rename to doc/git-rbc/index.md index 03a10331..7fcca4f0 100644 --- a/doc/alias/git-rbc/index.md +++ b/doc/git-rbc/index.md @@ -2,14 +2,16 @@ ## Rebase continue i.e. continue the rebase process -```gitconfig +Git alias: + +```git # git rbc: rebase - resolution. rbc = rebase --continue ``` Example: -```sh +```shell $ git rbc ``` diff --git a/doc/alias/git-rbi/index.md b/doc/git-rbi/index.md similarity index 82% rename from doc/alias/git-rbi/index.md rename to doc/git-rbi/index.md index 8fecfd8d..3e2148ae 100644 --- a/doc/alias/git-rbi/index.md +++ b/doc/git-rbi/index.md @@ -2,13 +2,15 @@ ## Rebase interactive i.e. do a rebase with prompts -```gitconfig +Git alias: + +```git # git rbi: rbi = rebase --interactive ``` Example: -```sh +```shell $ git rbi ``` diff --git a/doc/alias/git-rbiu/index.md b/doc/git-rbiu/index.md similarity index 90% rename from doc/alias/git-rbiu/index.md rename to doc/git-rbiu/index.md index 85905c89..12091419 100644 --- a/doc/alias/git-rbiu/index.md +++ b/doc/git-rbiu/index.md @@ -1,14 +1,16 @@ # git rbiu -## Rebase interactive on our unpushed commits. +## Rebase interactive on unpushed commits -```gitconfig +Git alias: + +```git rbiu = rebase --interactive @{upstream} ``` Example: -```sh +```shell $ git rbiu ``` @@ -20,7 +22,7 @@ I have another where I made a spelling mistake in the commit message. When I run "git rbiu" I get dropped into my editor with this: -```sh +```shell pick 7f06d36 foo pick ad544d0 goo pick de3083a hoo @@ -33,7 +35,7 @@ I also edit "hoo" to rename it to "whatever". I make the file look like this: -```sh +```shell pick 7f06d36 foo s ad544d0 goo r de3083a whatever @@ -42,7 +44,7 @@ This gives me two new commit messages to edit, which I update. Now when I push the remote repo host receives two commits: -```sh +```shell 3400455 - foo 5dae0a0 - whatever ``` diff --git a/doc/alias/git-rbs/index.md b/doc/git-rbs/index.md similarity index 84% rename from doc/alias/git-rbs/index.md rename to doc/git-rbs/index.md index c0f55fe1..9adea602 100644 --- a/doc/alias/git-rbs/index.md +++ b/doc/git-rbs/index.md @@ -2,13 +2,15 @@ ## Rebase skip i.e. restart the rebase process by skipping the current patch -```gitconfig +Git alias: + +```git # git rbs: rbs = rebase --skip ``` Example: -```sh +```shell $ git rbs ``` diff --git a/doc/git-rebase-branch/index.md b/doc/git-rebase-branch/index.md new file mode 100644 index 00000000..0809d92d --- /dev/null +++ b/doc/git-rebase-branch/index.md @@ -0,0 +1,15 @@ +# git rebase-branch + +## Interactively rebase all the commits on the current branch + +Git alias: + +```git +rebase-branch = !"git rebase --interactive `git merge-base main HEAD`" +``` + +Example: + +```shell +$ git rebase-branch +``` diff --git a/doc/alias/git-rebase-interactive-branch/index.md b/doc/git-rebase-interactive-branch/index.md similarity index 89% rename from doc/alias/git-rebase-interactive-branch/index.md rename to doc/git-rebase-interactive-branch/index.md index f27114b0..5875dd5b 100644 --- a/doc/alias/git-rebase-interactive-branch/index.md +++ b/doc/git-rebase-interactive-branch/index.md @@ -2,12 +2,14 @@ ## Rebase interactive on all the commits on the current branch -```gitconfig +Git alias: + +```git rebase-interactive-branch = !"git rebase --interactive `git merge-base main HEAD`" ``` Example: -```sh +```shell $ git rebase-interactive-branch ``` diff --git a/doc/git-rebase-recent/index.md b/doc/git-rebase-recent/index.md new file mode 100644 index 00000000..40ee3232 --- /dev/null +++ b/doc/git-rebase-recent/index.md @@ -0,0 +1,17 @@ +# git rebase-recent + +## Rebase recent commits with interactive + +Git alias: + +```git +rebase-recent = !git rebase --interactive $(git remote-ref) +``` + +Example: + +```shell +$ git rebase-recent +``` + +Thanks to jtolds on stackoverflow. diff --git a/doc/git-ref-recent/index.md b/doc/git-ref-recent/index.md new file mode 100644 index 00000000..e69de29b diff --git a/doc/alias/git-refs-by-date/index.md b/doc/git-refs-by-date/index.md similarity index 89% rename from doc/alias/git-refs-by-date/index.md rename to doc/git-refs-by-date/index.md index 9002aab0..5f9a7215 100644 --- a/doc/alias/git-refs-by-date/index.md +++ b/doc/git-refs-by-date/index.md @@ -2,13 +2,15 @@ ## Show refs sorted by date for branches -```gitconfig +Git alias: + +```git refs-by-date = for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short)' ``` Example: -```sh +```shell $ git refs-by-date ``` diff --git a/doc/alias/git-reincarnate/index.md b/doc/git-reincarnate/index.md similarity index 95% rename from doc/alias/git-reincarnate/index.md rename to doc/git-reincarnate/index.md index 3b1a9e6b..48393de9 100644 --- a/doc/alias/git-reincarnate/index.md +++ b/doc/git-reincarnate/index.md @@ -2,7 +2,9 @@ ## Delete a branch then create it anew -```gitconfig +Git alias: + +```git reincarnate = !"f() { \ [[ -n $@ ]] && \ git checkout \"$@\" && \ @@ -16,7 +18,7 @@ reincarnate = !"f() { \ Example: -```sh +```shell $ git reincarnate ``` diff --git a/doc/git-remote-ref/index.md b/doc/git-remote-ref/index.md new file mode 100644 index 00000000..4ce93b29 --- /dev/null +++ b/doc/git-remote-ref/index.md @@ -0,0 +1,23 @@ +# git remote-ref + +## TODO + +Git alias: + +```git +remote-ref = !"sh -c ' \ + 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'" +``` + +Example: + +```shell +$ git remote-ref +``` + +Thanks to jtolds on stackoverflow diff --git a/doc/alias/git-remotes-prune/index.md b/doc/git-remotes-prune/index.md similarity index 83% rename from doc/alias/git-remotes-prune/index.md rename to doc/git-remotes-prune/index.md index d82aa37d..a9604de6 100644 --- a/doc/alias/git-remotes-prune/index.md +++ b/doc/git-remotes-prune/index.md @@ -1,14 +1,16 @@ # git remotes-prune -## For each remote branch, prune it. +## For each remote branch, prune it -```gitconfig +Git alias: + +```git remotes-prune = !git remote | xargs -n 1 git remote prune ``` Example: -```sh +```shell $ git remotes-prune ``` diff --git a/doc/alias/git-remotes-push/index.md b/doc/git-remotes-push/index.md similarity index 64% rename from doc/alias/git-remotes-push/index.md rename to doc/git-remotes-push/index.md index eca2f2d7..e623eb29 100644 --- a/doc/alias/git-remotes-push/index.md +++ b/doc/git-remotes-push/index.md @@ -1,13 +1,15 @@ # git remotes-push -## For each remote branch, push it. +## For each remote branch, push it -```gitconfig +Git alias: + +```git remotes-push = !git remote | xargs -I% -n1 git push % ``` Example: -```sh +```shell $ git remotes-push ``` diff --git a/doc/alias/git-repacker/index.md b/doc/git-repacker/index.md similarity index 93% rename from doc/alias/git-repacker/index.md rename to doc/git-repacker/index.md index 1475414f..d31c60f3 100644 --- a/doc/alias/git-repacker/index.md +++ b/doc/git-repacker/index.md @@ -1,14 +1,16 @@ # git repacker -## Repack a repo as recommended by Linus. +## Repack a repo as recommended by Linus -```gitconfig +Git alias: + +```git repacker = repack -a -d -f --depth=300 --window=300 --window-memory=1g ``` Example: -```sh +```shell $ git repacker ``` @@ -17,7 +19,7 @@ This command takes a long time to run, perhaps even overnight. It does the equivalent of "git gc --aggressive" but done *properly*, which is to do something like: -```sh +```shell git repack -a -d --depth=250 --window=250 ``` diff --git a/doc/git-reset-commit-hard-clean/index.md b/doc/git-reset-commit-hard-clean/index.md new file mode 100644 index 00000000..bd087cb8 --- /dev/null +++ b/doc/git-reset-commit-hard-clean/index.md @@ -0,0 +1,20 @@ +# git reset-commit-hard-clean + +# Move backwards on the commit chain + +Git alias: + +```git +reset-commit-hard-clean = !git reset --hard HEAD~1 && git clean -df +``` + +Example: + +```shell +$ git reset-commit-hard-clean +``` + +See how to use this alias and related ones: + +* [git reset-*](../git-reset) +* [git undo-*](../git-undo) diff --git a/doc/git-reset-commit-hard/index.md b/doc/git-reset-commit-hard/index.md new file mode 100644 index 00000000..4bd6474e --- /dev/null +++ b/doc/git-reset-commit-hard/index.md @@ -0,0 +1,19 @@ +# git reset-commit-hard + +# Move backwards on the commit chain +Git alias: + +```git +reset-commit-hard = reset --hard HEAD~1 +``` + +Example: + +```shell +$ git reset-commit-hard +``` + +See how to use this alias and related ones: + +* [git reset-*](../git-reset) +* [git undo-*](../git-undo) diff --git a/doc/git-reset-commit/index.md b/doc/git-reset-commit/index.md new file mode 100644 index 00000000..d9d3e5ef --- /dev/null +++ b/doc/git-reset-commit/index.md @@ -0,0 +1,20 @@ +# git reset-commit + +# Move backwards on the commit chain + +Git alias: + +```git +reset-commit = reset --soft HEAD~1 +``` + +Example: + +```shell +$ git reset-commit +``` + +See how to use this alias and related ones: + +* [git reset-*](../git-reset) +* [git undo-*](../git-undo) diff --git a/doc/git-reset-to-pristine/index.md b/doc/git-reset-to-pristine/index.md new file mode 100644 index 00000000..537e1cfb --- /dev/null +++ b/doc/git-reset-to-pristine/index.md @@ -0,0 +1,19 @@ +# git reset-to-pristine + +# Reset commits and clean all differences +Git alias: + +```git +reset-to-pristine = !git reset --hard && git clean -dffx +``` + +Example: + +```shell +$ git reset-to-pristine +``` + +See how to use this alias and related ones: + +* [git reset-*](../git-reset) +* [git undo-*](../git-undo) diff --git a/doc/git-reset-to-upstream/index.md b/doc/git-reset-to-upstream/index.md new file mode 100644 index 00000000..acaa989d --- /dev/null +++ b/doc/git-reset-to-upstream/index.md @@ -0,0 +1,20 @@ +# git reset-to-upstream + +# Reset commits back to the upstream branch + +Git alias: + +```git +reset-to-upstream = !git reset --hard $(git upstream-branch) +``` + +Example: + +```shell +$ git reset-to-upstream +``` + +See how to use this alias and related ones: + +* [git reset-*](../git-reset) +* [git undo-*](../git-undo) diff --git a/doc/alias/git-reset/index.md b/doc/git-reset/index.md similarity index 82% rename from doc/alias/git-reset/index.md rename to doc/git-reset/index.md index 9a56463e..d992d28c 100644 --- a/doc/alias/git-reset/index.md +++ b/doc/git-reset/index.md @@ -2,20 +2,22 @@ ## Move backwards on the commit chain -```gitconfig +Git alias: + +```git reset-commit = reset --soft HEAD~1 reset-commit-hard = reset --hard HEAD~1 -reset-commit-clean = !git reset --hard HEAD~1 && git clean -df +reset-commit-hard-clean = !git reset --hard HEAD~1 && git clean -df reset-to-pristine = !git reset --hard && git clean -dffx reset-to-upstream = !git reset --hard $(git upstream-branch) ``` Example: -```sh +```shell $ git reset-commit $ git reset-commit-hard -$ git reset-commit-clean +$ git reset-commit-hard-clean $ git reset-to-pristine $ git reset-to-upstrea ``` diff --git a/doc/alias/git-rev-list-all-objects-by-size-and-name/index.md b/doc/git-rev-list-all-objects-by-size-and-name/index.md similarity index 94% rename from doc/alias/git-rev-list-all-objects-by-size-and-name/index.md rename to doc/git-rev-list-all-objects-by-size-and-name/index.md index 6fd71cf0..c917d941 100644 --- a/doc/alias/git-rev-list-all-objects-by-size-and-name/index.md +++ b/doc/git-rev-list-all-objects-by-size-and-name/index.md @@ -2,13 +2,15 @@ ## List all objects by size in bytes and file name. -```gitconfig +Git alias: + +```git rev-list-all-objects-by-size-and-name = !"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" ``` Example: -```sh +```shell $ git rev-list-all-objects-by-size-and-name ``` diff --git a/doc/alias/git-rev-list-all-objects-by-size/index.md b/doc/git-rev-list-all-objects-by-size/index.md similarity index 91% rename from doc/alias/git-rev-list-all-objects-by-size/index.md rename to doc/git-rev-list-all-objects-by-size/index.md index 8c9ca9df..94db06ad 100644 --- a/doc/alias/git-rev-list-all-objects-by-size/index.md +++ b/doc/git-rev-list-all-objects-by-size/index.md @@ -2,13 +2,15 @@ ## List all blobs by size in bytes -```gitconfig +Git alias: + +```git rev-list-all-objects-by-size = !"git rev-list --all --objects | awk '{print $1}'| git cat-file --batch-check | fgrep blob | sort -k3nr" ``` Example: -```sh +```shell $ git rev-list-all-objects-by-size ``` diff --git a/doc/alias/git-rl/index.md b/doc/git-rl/index.md similarity index 70% rename from doc/alias/git-rl/index.md rename to doc/git-rl/index.md index c90a596e..4b334597 100644 --- a/doc/alias/git-rl/index.md +++ b/doc/git-rl/index.md @@ -1,14 +1,16 @@ # git rl -## Shortcut for "reflog" +## Short for "git reflog" -```gitconfig +Git alias: + +```git rl = reflog ``` Example: -```sh +```shell $ git rl ``` diff --git a/doc/git-rr/index.md b/doc/git-rr/index.md new file mode 100644 index 00000000..6a37d0b6 --- /dev/null +++ b/doc/git-rr/index.md @@ -0,0 +1,15 @@ +# git rr + +## Short for "git remote" + +Git alias: + +```git +rr = remote +``` + +Example: + +```shell +$ git rr +``` diff --git a/doc/alias/git-rrp/index.md b/doc/git-rrp/index.md similarity index 82% rename from doc/alias/git-rrp/index.md rename to doc/git-rrp/index.md index 5c98688e..957eb81e 100644 --- a/doc/alias/git-rrp/index.md +++ b/doc/git-rrp/index.md @@ -2,12 +2,14 @@ ## Remote prune i.e. delete all stale remote-tracking branches under -```gitconfig +Git alias: + +```git rrp = remote prune ``` Example: -```sh +```shell $ git rrp ``` diff --git a/doc/alias/git-rrs/index.md b/doc/git-rrs/index.md similarity index 81% rename from doc/alias/git-rrs/index.md rename to doc/git-rrs/index.md index 83caf7f1..4e9c055d 100644 --- a/doc/alias/git-rrs/index.md +++ b/doc/git-rrs/index.md @@ -2,12 +2,14 @@ ## Remote show i.e. give information about the remote -```gitconfig +Git alias: + +```git rrs = remote show ``` Example: -```sh +```shell $ git rrs ``` diff --git a/doc/alias/git-rru/index.md b/doc/git-rru/index.md similarity index 85% rename from doc/alias/git-rru/index.md rename to doc/git-rru/index.md index 67d93165..8edb0fb7 100644 --- a/doc/alias/git-rru/index.md +++ b/doc/git-rru/index.md @@ -2,12 +2,14 @@ ## remote update i.e. fetch updates for a named set of remotes in the repository as defined by remotes -```gitconfig +Git alias: + +```git rru = remote update ``` Example: -```sh +```shell $ git rru ``` diff --git a/doc/alias/git-rv/index.md b/doc/git-rv/index.md similarity index 66% rename from doc/alias/git-rv/index.md rename to doc/git-rv/index.md index 09a91fa0..3ffa0c35 100644 --- a/doc/alias/git-rv/index.md +++ b/doc/git-rv/index.md @@ -1,14 +1,16 @@ # git rv -## Shortcut for "revert" +## Short for "git revert" -```gitconfig +Git alias: + +```git rv = revert ``` Example: -```sh +```shell $ git rv ``` diff --git a/doc/alias/git-rvnc/index.md b/doc/git-rvnc/index.md similarity index 68% rename from doc/alias/git-rvnc/index.md rename to doc/git-rvnc/index.md index cc917b1e..fb8aeb94 100644 --- a/doc/alias/git-rvnc/index.md +++ b/doc/git-rvnc/index.md @@ -1,14 +1,16 @@ # git rvnc -## revert with no commit i.e. without autocommit +## Revert with no commit i.e. without autocommit -```gitconfig +Git alias: + +```git rvnc = revert --no-commit ``` Example: -```sh +```shell $ git rvnc ``` diff --git a/doc/git-s/index.md b/doc/git-s/index.md new file mode 100644 index 00000000..f65666c6 --- /dev/null +++ b/doc/git-s/index.md @@ -0,0 +1,15 @@ +# git s + +## Short for "git status" + +Git alias: + +```git +s = status +``` + +Example: + +```shell +$ git s +``` diff --git a/doc/git-sb/index.md b/doc/git-sb/index.md new file mode 100644 index 00000000..4a149197 --- /dev/null +++ b/doc/git-sb/index.md @@ -0,0 +1,15 @@ +# git sb + +## Short for "git show-branch" i.e. print a list of branches and their commits + +Git alias: + +```git +sb = show-branch +``` + +Example: + +```shell +$ git sb +``` diff --git a/doc/alias/git-sbdo/index.md b/doc/git-sbdo/index.md similarity index 81% rename from doc/alias/git-sbdo/index.md rename to doc/git-sbdo/index.md index 47b43084..665c7e0f 100644 --- a/doc/alias/git-sbdo/index.md +++ b/doc/git-sbdo/index.md @@ -2,13 +2,15 @@ ## Show branch list with date order -```gitconfig +Git alias: + +```git # git sbdo - sbdo = show-branch --date-order ``` Example: -```sh +```shell $ git sbdo ``` diff --git a/doc/alias/git-sbto/index.md b/doc/git-sbto/index.md similarity index 80% rename from doc/alias/git-sbto/index.md rename to doc/git-sbto/index.md index 24af5865..c4cd1610 100644 --- a/doc/alias/git-sbto/index.md +++ b/doc/git-sbto/index.md @@ -2,12 +2,14 @@ ## Show branch list with topological order -```gitconfig +Git alias: + +```git sbdo = show-branch --topo-order ``` Example: -```sh +```shell $ git sbto ``` diff --git a/doc/alias/git-search-commits/index.md b/doc/git-search-commits/index.md similarity index 75% rename from doc/alias/git-search-commits/index.md rename to doc/git-search-commits/index.md index 2ecb9306..18547d96 100644 --- a/doc/alias/git-search-commits/index.md +++ b/doc/git-search-commits/index.md @@ -2,7 +2,9 @@ ## Search for a given string in all patches and print commit messages -```gitconfig +Git alias: + +```git search-commits = !"f() { \ query=\"$1\"; \ shift; \ @@ -12,26 +14,26 @@ search-commits = !"f() { \ Example: -```sh +```shell $ git search-commits ``` Example: search for any commit that adds or removes string "foobar": -```sh -$ git searchcommits foobar +```shell +$ git search-commits foobar ``` Example: search commits for string "foobar" in directory "src/lib": -```sh -$ git searchcommits foobar src/lib +```shell +$ git search-commits foobar src/lib ``` Example: search commits for "foobar", print full diff of commit with 1 line context: -```sh -$ git searchcommits foobar --pickaxe-all -U1 src/lib +```shell +$ git search-commits foobar --pickaxe-all -U1 src/lib ``` Posted by Mikko Rantalainen on StackOverflow. diff --git a/doc/alias/git-serve/index.md b/doc/git-serve/index.md similarity index 91% rename from doc/alias/git-serve/index.md rename to doc/git-serve/index.md index 7e320fb3..3e528f86 100644 --- a/doc/alias/git-serve/index.md +++ b/doc/git-serve/index.md @@ -2,13 +2,15 @@ ## Serve the local directory by starting a git server daemon -```gitconfig +Git alias: + +```git serve = "-c daemon.receivepack=true daemon --base-path=. --export-all --reuseaddr --verbose" ``` Example: -```sh +```shell $ git serve ``` diff --git a/doc/git-show-unreachable/index.md b/doc/git-show-unreachable/index.md new file mode 100644 index 00000000..ad1bd593 --- /dev/null +++ b/doc/git-show-unreachable/index.md @@ -0,0 +1,17 @@ +# git show-unreachable + +## Show logs of unreachable commits + +Git alias: + +```git +show-unreachable = !"git fsck --unreachable | grep commit | cut -d\" \" -f3 | xargs git log" +``` + +Example: + +```shell +$ git show-unreachable +``` + +This can be useful, for example, when recovering contents of dropped stashes or reset commits. diff --git a/doc/alias/git-sm/index.md b/doc/git-sm/index.md similarity index 73% rename from doc/alias/git-sm/index.md rename to doc/git-sm/index.md index 145f588b..8b507df2 100644 --- a/doc/alias/git-sm/index.md +++ b/doc/git-sm/index.md @@ -1,14 +1,16 @@ # git sm -## Shortcut for "submodule" +## Short for "git submodule" -```gitconfig +Git alias: + +```git sm = submodule ``` Example: -```sh +```shell $ git sm ``` diff --git a/doc/alias/git-sma/index.md b/doc/git-sma/index.md similarity index 80% rename from doc/alias/git-sma/index.md rename to doc/git-sma/index.md index 4f96915c..af24bd54 100644 --- a/doc/alias/git-sma/index.md +++ b/doc/git-sma/index.md @@ -2,12 +2,14 @@ ## Submodule add i.e. add a submodule to this repo -```gitconfig +Git alias: + +```git sma = submodule add ``` Example: -```sh +```shell $ git sma foo ``` diff --git a/doc/alias/git-smi/index.md b/doc/git-smi/index.md similarity index 81% rename from doc/alias/git-smi/index.md rename to doc/git-smi/index.md index 66f3db8b..0e1d91df 100644 --- a/doc/alias/git-smi/index.md +++ b/doc/git-smi/index.md @@ -2,12 +2,14 @@ ## Submodule init i.e. initialize a submodule in this repo -```gitconfig +Git alias: + +```git smi = submodule init ``` Example: -```sh +```shell $ git smi foo ``` diff --git a/doc/alias/git-sms/index.md b/doc/git-sms/index.md similarity index 81% rename from doc/alias/git-sms/index.md rename to doc/git-sms/index.md index 345fa93c..4bf70b1d 100644 --- a/doc/alias/git-sms/index.md +++ b/doc/git-sms/index.md @@ -2,12 +2,14 @@ ## Submodule sync i.e. synchronize a submodule in this repo -```gitconfig +Git alias: + +```git sms = submodule sync ``` Example: -```sh +```shell $ git sms foo ``` diff --git a/doc/alias/git-smu/index.md b/doc/git-smu/index.md similarity index 81% rename from doc/alias/git-smu/index.md rename to doc/git-smu/index.md index a6e02387..75ea0137 100644 --- a/doc/alias/git-smu/index.md +++ b/doc/git-smu/index.md @@ -2,12 +2,14 @@ ## submodule update i.e. update a submodule in this repo -```gitconfig +Git alias: + +```git smu = submodule update ``` Example: -```sh +```shell $ git smu foo ``` diff --git a/doc/alias/git-smui/index.md b/doc/git-smui/index.md similarity index 80% rename from doc/alias/git-smui/index.md rename to doc/git-smui/index.md index f86031cf..3faa5d6f 100644 --- a/doc/alias/git-smui/index.md +++ b/doc/git-smui/index.md @@ -2,12 +2,14 @@ ## submodule update with initialize -```gitconfig +Git alias: + +```git smui = submodule update --init ``` Example: -```sh +```shell $ git smui foo ``` diff --git a/doc/alias/git-smuir/index.md b/doc/git-smuir/index.md similarity index 90% rename from doc/alias/git-smuir/index.md rename to doc/git-smuir/index.md index 683dce3f..f9828c25 100644 --- a/doc/alias/git-smuir/index.md +++ b/doc/git-smuir/index.md @@ -2,14 +2,16 @@ ## submodule update with initialize and recursive; this is useful to bring a submodule fully up to date. -```gitconfig +Git alias: + +```git # git smuir: smuir = submodule update --init --recursive ``` Example: -```sh +```shell $ git smuir foo ``` diff --git a/doc/alias/git-snapshot/index.md b/doc/git-snapshot/index.md similarity index 93% rename from doc/alias/git-snapshot/index.md rename to doc/git-snapshot/index.md index 21a9bca7..a17023be 100644 --- a/doc/alias/git-snapshot/index.md +++ b/doc/git-snapshot/index.md @@ -2,13 +2,15 @@ ## Take a snapshot of your current working tree -```gitconfig +Git alias: + +```git snapshot = !git stash push --include-untracked --message \"snapshot: $(date)\" && git stash apply \"stash@{0}\" ``` Example: -```sh +```shell $ git snapshot ``` @@ -19,13 +21,13 @@ into a commit but daren't stray too far from now without a backup. Running this … -```sh +```shell $ git snapshot ``` … creates this stash: -```sh +```shell stash@{0}: On feature/handy-git-tricks: snapshot: Mon Apr 8 12:39:06 BST 2013 ``` diff --git a/doc/alias/git-ss/index.md b/doc/git-ss/index.md similarity index 75% rename from doc/alias/git-ss/index.md rename to doc/git-ss/index.md index fad8c3dc..ede18d13 100644 --- a/doc/alias/git-ss/index.md +++ b/doc/git-ss/index.md @@ -2,12 +2,14 @@ ## status with short format -```gitconfig +Git alias: + +```git ss = status --short ``` Example: -```sh +```shell $ git ss ``` diff --git a/doc/alias/git-ssb/index.md b/doc/git-ssb/index.md similarity index 80% rename from doc/alias/git-ssb/index.md rename to doc/git-ssb/index.md index 91f795e2..8ccb9464 100644 --- a/doc/alias/git-ssb/index.md +++ b/doc/git-ssb/index.md @@ -2,12 +2,14 @@ ## status with short format and branch info -```gitconfig +Git alias: + +```git ssb = status --short --branch ``` Example: -```sh +```shell $ git ssb ``` diff --git a/doc/alias/git-stashes/index.md b/doc/git-stashes/index.md similarity index 92% rename from doc/alias/git-stashes/index.md rename to doc/git-stashes/index.md index 80c5b51f..c29821f7 100644 --- a/doc/alias/git-stashes/index.md +++ b/doc/git-stashes/index.md @@ -2,13 +2,15 @@ ## List stashes -```gitconfig +Git alias: + +```git stashes = stash list ``` Example: -```sh +```shell $ git stashes ``` diff --git a/doc/git-submodule/index.md b/doc/git-submodule/index.md new file mode 100644 index 00000000..8ba106b3 --- /dev/null +++ b/doc/git-submodule/index.md @@ -0,0 +1,14 @@ +# git submodule + +## Aliases related to git submodule + + +### Shortcuts + +* [git sm](git-sm) = submodule +* [git smi](git-smi) = submodule init +* [git sma](git-sma) = submodule add +* [git sms](git-sms) = submodule sync +* [git smu](git-smu) = submodule update +* [git smui](git-smui) = submodule update --init +* [git smuir](git-smuir) = submodule update --init --recursive diff --git a/doc/alias/git-summary/index.md b/doc/git-summary/index.md similarity index 98% rename from doc/alias/git-summary/index.md rename to doc/git-summary/index.md index 1dfbb6d1..1a8d885c 100644 --- a/doc/alias/git-summary/index.md +++ b/doc/git-summary/index.md @@ -2,7 +2,9 @@ ## Show a helpful summary of some typical metrics -```gitconfig +Git alias: + +```git summary = "!f() { \ printf \"Summary of this branch...\n\"; \ printf \"%s\n\" $(git rev-parse --abbrev-ref HEAD); \ @@ -28,7 +30,7 @@ summary = "!f() { \ Example: -```sh +```shell $ git summary ``` diff --git a/doc/git-svn-b/index.md b/doc/git-svn-b/index.md new file mode 100644 index 00000000..3fab95c7 --- /dev/null +++ b/doc/git-svn-b/index.md @@ -0,0 +1,15 @@ +# git svn-b + +## Subversion branch + +Git alias: + +```git +svn-b = svn branch +``` + +Example: + +```shell +$ git svn-b +``` diff --git a/doc/git-svn-c/index.md b/doc/git-svn-c/index.md new file mode 100644 index 00000000..496e548e --- /dev/null +++ b/doc/git-svn-c/index.md @@ -0,0 +1,15 @@ +# git svn-c + +## Subversion commit + +Git alias: + +```git +svn-c = svn dcommit +``` + +Example: + +```shell +$ git svn-c +``` diff --git a/doc/git-svn-cp/index.md b/doc/git-svn-cp/index.md new file mode 100644 index 00000000..c0a1bd91 --- /dev/null +++ b/doc/git-svn-cp/index.md @@ -0,0 +1,15 @@ +# git svn-cp + +## Subversion cherry pick + +Git alias: + +```git +svn-cp = !GIT_EDITOR='sed -i /^git-svn-id:/d' git cherry-pick --edit +``` + +Example: + +```shell +$ git svn-cp +``` diff --git a/doc/git-svn-m/index.md b/doc/git-svn-m/index.md new file mode 100644 index 00000000..d5614879 --- /dev/null +++ b/doc/git-svn-m/index.md @@ -0,0 +1,15 @@ +# git svn-m + +## Subversion merge + +Git alias: + +```git +svn-m = merge --squash +``` + +Example: + +```shell +$ git svn-m +``` diff --git a/doc/alias/git-svn/index.md b/doc/git-svn/index.md similarity index 89% rename from doc/alias/git-svn/index.md rename to doc/git-svn/index.md index 3a457145..169d999b 100644 --- a/doc/alias/git-svn/index.md +++ b/doc/git-svn/index.md @@ -2,7 +2,9 @@ ## Subversion version control helpers -```gitconfig +Git alias: + +```git svn-b = svn branch svn-m = merge --squash svn-c = svn dcommit @@ -11,7 +13,7 @@ svn-cp = !GIT_EDITOR='sed -i /^git-svn-id:/d' git cherry-pick --edit Example: -```sh +```shell $ git svn-b $ git svn-m $ git svn-c diff --git a/doc/alias/git-tags/index.md b/doc/git-tags/index.md similarity index 92% rename from doc/alias/git-tags/index.md rename to doc/git-tags/index.md index 47fb392f..f6be1561 100644 --- a/doc/alias/git-tags/index.md +++ b/doc/git-tags/index.md @@ -2,13 +2,15 @@ ## List tags -```gitconfig +Git alias: + +```git tags = tag -n1 --list ``` Example: -```sh +```shell $ git tags ``` diff --git a/doc/git-theirs/index.md b/doc/git-theirs/index.md new file mode 100644 index 00000000..6504607e --- /dev/null +++ b/doc/git-theirs/index.md @@ -0,0 +1,23 @@ +# git theirs + +## Checkout their version of a file and add it + +Git alias: + +```git +theirs = !"f() { git checkout --theirs $@ && git add $@; }; f" +``` + +Example: + +```shell +$ git theirs +``` + +Compare: + +* [git ours & git theirs](../git-ours-git-theirs) (describes both) + +* [git ours](../git-ours) + +* [git theirs](../git-theirs) (this alias) diff --git a/doc/alias/git-top-name/index.md b/doc/git-top/index.md similarity index 50% rename from doc/alias/git-top-name/index.md rename to doc/git-top/index.md index 8ada8e15..f7f3fcc5 100644 --- a/doc/alias/git-top-name/index.md +++ b/doc/git-top/index.md @@ -1,14 +1,16 @@ -# git top-name +# git top ## Get the top level directory name -```gitconfig -top-name = rev-parse --show-toplevel +Git alias: + +```git +top = rev-parse --show-toplevel ``` Example: -```sh -$ git top-name +```shell +$ git top /home/alice/projects/example ``` diff --git a/doc/alias/git-topic-branch/index.md b/doc/git-topic-base/index.md similarity index 88% rename from doc/alias/git-topic-branch/index.md rename to doc/git-topic-base/index.md index c780b406..aa019a03 100644 --- a/doc/alias/git-topic-branch/index.md +++ b/doc/git-topic-base/index.md @@ -1,15 +1,17 @@ -# git topic-branch +# git topic-base ## Show the project base topic branch name -```gitconfig -topic-branch = "!git config --get init.topicBaseBranchName || git config --get init.defaultBranch" +Git alias: + +```git +topic-base = "!git config --get init.topicBaseBranchName || git config --get init.defaultBranch" ``` Example: ``` -$ git topic-branch +$ git topic-base main ``` @@ -37,7 +39,7 @@ You can customize the base topic branch name by using `git config`. You can customize it for your local repo, or your own user's global configuration, or your system configuration, by using `git config`: -```sh +```shell $ git config --local init.topicBaseBranchName "foo" $ git config --global init.topicBaseBranchName "foo" @@ -49,7 +51,7 @@ Example: ``` $ git config init.topicBaseBranchName "foo" -$ git topic-branch +$ git topic-base foo ``` diff --git a/doc/alias/git-topic-start/index.md b/doc/git-topic-begin/index.md similarity index 77% rename from doc/alias/git-topic-start/index.md rename to doc/git-topic-begin/index.md index a37e4555..3deafc5b 100644 --- a/doc/alias/git-topic-start/index.md +++ b/doc/git-topic-begin/index.md @@ -1,11 +1,13 @@ -# git topic-start +# git topic-begin -## Begin a topic branch +## Start a new topic branch -```gitconfig -topic-start = "!f(){ \ +Git alias: + +```git +topic-begin = "!f(){ \ new_branch=\"$1\"; \ - old_branch=$(git topic-branch); \ + old_branch=$(git topic-base); \ git checkout \"$old_branch\"; git pull; \ git checkout -b \"$new_branch\" \"$old_branch\"; \ git push --set-upstream origin \"$new_branch\"; \ @@ -14,8 +16,8 @@ topic-start = "!f(){ \ Example: -```sh -$ git topic-start add-feature-foo +```shell +$ git topic-begin add-feature-foo ``` Customize this alias as you like for your own workflow. @@ -27,7 +29,7 @@ Our workflow does these steps: 1. Update the base topic branch. - 2. Create a new topic branch based on the base topic branch. + 2. Create a new topic branch based on the topic base branch name, 3. Push the new topic branch, so team members can see it. diff --git a/doc/alias/git-topic-stop/index.md b/doc/git-topic-end/index.md similarity index 81% rename from doc/alias/git-topic-stop/index.md rename to doc/git-topic-end/index.md index 3c64c01d..39d3e191 100644 --- a/doc/alias/git-topic-stop/index.md +++ b/doc/git-topic-end/index.md @@ -1,17 +1,19 @@ -# git topic-stop +# git topic-end -## End a topic branch +## Finish the current topic branch -```gitconfig -topic-stop = "!f(){ \ - new_branch=$(git current-branch); \ - old_branch=$(git topic-branch); \ +Git alias: + +```git +topic-end = "!f(){ \ + new_branch=$(git my-branch); \ + old_branch=$(git topic-base); \ if [ \"$new_branch\" = \"$old_branch\" ]; then \ - printf \"You are asking to do git topic-stop,\n\"; \ + printf \"You are asking to do git topic-end,\n\"; \ printf \"but you are not on a new topic branch;\n\"; \ printf \"you are on the base topic branch: $old_branch.\n\"; \ printf \"Please checkout the topic branch that you want,\n\"; \ - printf \"then retry the git topic-stop command.\n\"; \ + printf \"then retry the git topic-end command.\n\"; \ else \ git push; \ git checkout \"$old_branch\"; \ @@ -23,8 +25,8 @@ topic-stop = "!f(){ \ Example: -```sh -$ git topic-stop +```shell +$ git topic-end ``` Customize this alias as you like for your own workflow. diff --git a/doc/alias/git-topic-move/index.md b/doc/git-topic-move/index.md similarity index 87% rename from doc/alias/git-topic-move/index.md rename to doc/git-topic-move/index.md index 6ceeb3ee..dfdae1f8 100644 --- a/doc/alias/git-topic-move/index.md +++ b/doc/git-topic-move/index.md @@ -2,10 +2,12 @@ ## Rename the current topic branch -```gitconfig +Git alias: + +```git topic-move = "!f(){ \ new_branch=\"$1\"; \ - old_branch=$(git current-branch); \ + old_branch=$(git my-branch); \ git branch --move \"$old_branch\" \"$new_branch\"; \ git push origin \":$old_branch\" \"$new_branch\"; \ };f" @@ -13,7 +15,7 @@ topic-move = "!f(){ \ Example: -```sh +```shell $ git topic-move foo ``` diff --git a/doc/alias/git-topic-sync/index.md b/doc/git-topic-sync/index.md similarity index 84% rename from doc/alias/git-topic-sync/index.md rename to doc/git-topic-sync/index.md index 6b99cadc..54b1bdea 100644 --- a/doc/alias/git-topic-sync/index.md +++ b/doc/git-topic-sync/index.md @@ -1,11 +1,13 @@ # git topic-sync -## Synchronize the topic branch by doing updates +## Synchronize the current topic branch by doing updates -```gitconfig +Git alias: + +```git topic-sync = "!f(){ \ - new_branch=$(git current-branch); \ - old_branch=$(git topic-branch); \ + new_branch=$(git my-branch); \ + old_branch=$(git topic-base); \ if [ \"$new_branch\" = \"$old_branch\" ]; then \ printf \"You are asking to do git topic-sync,\n\"; \ printf \"but you are not on a new topic branch;\n\"; \ @@ -21,7 +23,7 @@ topic-sync = "!f(){ \ Example: -```sh +```shell $ git topic-sync ``` diff --git a/doc/alias/git-topic/index.md b/doc/git-topic/index.md similarity index 61% rename from doc/alias/git-topic/index.md rename to doc/git-topic/index.md index 4ca2bd65..173b8b20 100644 --- a/doc/alias/git-topic/index.md +++ b/doc/git-topic/index.md @@ -2,13 +2,13 @@ ## Topic branch aliases -* [topic-branch](topic-branch) +* [topic-base](topic-base) -* [topic-start](topic-start) +* [topic-begin](topic-begin) -* [topic-sync](topic-sync) +* [topic-end](topic-end) -* [topic-stop](topic-stop) +* [topic-sync](topic-sync) * [topic-move](topic-move) @@ -19,33 +19,33 @@ Lots of people have lots of ideas about how to do various git flows. Some people like to use a topic branch for a new feature, or a hotfix patch, or refactoring work, or some spike research, etc. -Show your project base topic branch: +Show your project's topic base branch name: -```sh -$ git topic-branch +```shell +$ git topic-base ``` -Start work on a new topic branch, which creates your branch: +Begin your topic work by creating a new topic branch: -```sh -$ git topic-start add-feature-foo +```shell +$ git topic-begin ``` -Do work, and optionally sync our changes, which pushes and pulls: +End your topic work by finishing your existing topic branch: -```sh -$ git topic-sync +```shell +$ git topic-end ``` -Stop work on a topic branch, which deletes your branch: +Optional: synchronize your topic work, which pushes and pulls: -```sh -$ git topic-stop +```shell +$ git topic-sync ``` -If you want to move your branch a.k.a. rename it: +Optional: move your topic branch name i.e. rename your topic branch: -```sh +```shell $ git topic-move ``` diff --git a/doc/alias/git-track-all-remote-branches/index.md b/doc/git-track-all-remote-branches/index.md similarity index 93% rename from doc/alias/git-track-all-remote-branches/index.md rename to doc/git-track-all-remote-branches/index.md index a7891ee9..d71943f2 100644 --- a/doc/alias/git-track-all-remote-branches/index.md +++ b/doc/git-track-all-remote-branches/index.md @@ -2,7 +2,9 @@ ## Track all remote branches that aren't already being tracked -```gitconfig +Git alias: + +```git track-all-remote-branches = !"f() { \ git branch -r | \ grep -v ' -> ' | \ @@ -12,7 +14,7 @@ track-all-remote-branches = !"f() { \ Example: -```sh +```shell $ git track-all-remote-branches ``` diff --git a/doc/alias/git-track/index.md b/doc/git-track/index.md similarity index 92% rename from doc/alias/git-track/index.md rename to doc/git-track/index.md index e0e6adcc..4751a2e1 100644 --- a/doc/alias/git-track/index.md +++ b/doc/git-track/index.md @@ -2,7 +2,9 @@ ## Start tracking a branch, with default parameters, and showing the command -```gitconfig +Git alias: + +```git track = "!f(){ \ branch=$(git rev-parse --abbrev-ref HEAD); cmd=\"git branch $branch -u ${1:-origin}/${2:-$branch}\"; \ @@ -13,7 +15,7 @@ track = "!f(){ \ Example: -```sh +```shell $ git track ``` diff --git a/doc/alias/git-unadd/index.md b/doc/git-unadd/index.md similarity index 78% rename from doc/alias/git-unadd/index.md rename to doc/git-unadd/index.md index 0a9be0a6..8e062362 100644 --- a/doc/alias/git-unadd/index.md +++ b/doc/git-unadd/index.md @@ -2,12 +2,14 @@ ## Reset something that's been added -```gitconfig +Git alias: + +```git unadd = reset HEAD ``` Example: -```sh +```shell $ git unadd ``` diff --git a/doc/git-unassume-all/index.md b/doc/git-unassume-all/index.md new file mode 100644 index 00000000..3b8b5306 --- /dev/null +++ b/doc/git-unassume-all/index.md @@ -0,0 +1,17 @@ +# git unassume + +## Unassume all files + +Git alias: + +```git +unassume-all = "!git assumed | xargs git update-index --no-assume-unchanged" +``` + +Example: + +```shell +$ git unassume-all +``` + +To see how this works, see [git assume-* & git unassume-*](../git-assume-and-git-unassume) diff --git a/doc/git-unassume/index.md b/doc/git-unassume/index.md new file mode 100644 index 00000000..5e7d66d1 --- /dev/null +++ b/doc/git-unassume/index.md @@ -0,0 +1,17 @@ +# git unassume + +## Unassume files + +Git alias: + +```git +unassume = update-index --no-assume-unchanged +``` + +Example: + +```shell +$ git unassumed +``` + +To see how this works, see [git assume-* & git unassume-*](../git-assume-and-git-unassume) diff --git a/doc/alias/git-uncommit/index.md b/doc/git-uncommit/index.md similarity index 78% rename from doc/alias/git-uncommit/index.md rename to doc/git-uncommit/index.md index 470faad8..f8d0908c 100644 --- a/doc/alias/git-uncommit/index.md +++ b/doc/git-uncommit/index.md @@ -2,12 +2,14 @@ ## Reset one commit -```gitconfig +Git alias: + +```git uncommit = reset --soft HEAD~1 ``` Example: -```sh +```shell $ git uncommit ``` diff --git a/doc/git-undo-commit-hard-clean/index.md b/doc/git-undo-commit-hard-clean/index.md new file mode 100644 index 00000000..20ee2224 --- /dev/null +++ b/doc/git-undo-commit-hard-clean/index.md @@ -0,0 +1,20 @@ +# git undo-commit-hard-clean + +## Undo a commit with a hard reset and a clean + +Git alias: + +```git +undo-commit-hard-clean = !git reset --hard HEAD~1 && git clean -df +``` + +Example: + +```shell +$ git undo-commit-hard-clean +``` + +See how to use this alias and related ones: + +* [git undo-*](../git-undo) +* [git reset-*](../git-reset) diff --git a/doc/git-undo-commit-hard/index.md b/doc/git-undo-commit-hard/index.md new file mode 100644 index 00000000..87856026 --- /dev/null +++ b/doc/git-undo-commit-hard/index.md @@ -0,0 +1,20 @@ +# git undo-commit-hard + +## Undo a commit with a hard reset + +Git alias: + +```git +undo-commit-hard = reset --hard HEAD~1 +``` + +Example: + +```shell +$ git undo-commit-hard +``` + +See how to use this alias and related ones: + +* [git undo-*](../git-undo) +* [git reset-*](../git-reset) diff --git a/doc/git-undo-commit/index.md b/doc/git-undo-commit/index.md new file mode 100644 index 00000000..21b060bc --- /dev/null +++ b/doc/git-undo-commit/index.md @@ -0,0 +1,20 @@ +# git undo-commit + +## Undo a commit with a soft reset + +Git alias: + +```git +undo-commit = reset --soft HEAD~1 +``` + +Example: + +```shell +$ git undo-commit +``` + +See how to use this alias and related ones: + +* [git undo-*](../git-undo) +* [git reset-*](../git-reset) diff --git a/doc/git-undo-to-pristine/index.md b/doc/git-undo-to-pristine/index.md new file mode 100644 index 00000000..355282cf --- /dev/null +++ b/doc/git-undo-to-pristine/index.md @@ -0,0 +1,20 @@ +# git undo-to-pristine + +## Undo commits and clean all differences + +Git alias: + +```git +undo-to-pristine = !git reset --hard && git clean -dffx +``` + +Example: + +```shell +$ git undo-to-pristine +``` + +See how to use this alias and related ones: + +* [git undo-*](../git-undo) +* [git reset-*](../git-reset) diff --git a/doc/git-undo-to-upstream/index.md b/doc/git-undo-to-upstream/index.md new file mode 100644 index 00000000..4c3219de --- /dev/null +++ b/doc/git-undo-to-upstream/index.md @@ -0,0 +1,19 @@ +# git undo-to-upstream + +# Undo commits back to the upstream branch +Git alias: + +```git +undo-to-upstream = !git reset --hard $(git upstream-branch) +``` + +Example: + +```shell +$ git undo-to-upstream +``` + +See how to use this alias and related ones: + +* [git undo-*](../git-undo) +* [git reset-*](../git-reset) diff --git a/doc/alias/git-undo/index.md b/doc/git-undo/index.md similarity index 76% rename from doc/alias/git-undo/index.md rename to doc/git-undo/index.md index 7f2d51f0..0bfe5aba 100644 --- a/doc/alias/git-undo/index.md +++ b/doc/git-undo/index.md @@ -1,21 +1,23 @@ # git undo-* -# Move backwards on the commit chain +## Move backwards on the commit chain -```gitconfig +Git alias: + +```git undo-commit = reset --soft HEAD~1 undo-commit-hard = reset --hard HEAD~1 -undo-commit-clean = !git reset --hard HEAD~1 && git clean -df +undo-commit-hard-clean = !git reset --hard HEAD~1 && git clean -df undo-to-pristine = !git reset --hard && git clean -dffx undo-to-upstream = !git reset --hard $(git upstream-branch) ``` Example: -```sh +```shell $ git undo-commit $ git undo-commit-hard -$ git undo-commit-clean +$ git undo-commit-hard-clean $ git undo-to-pristine $ git undo-to-upstream ``` diff --git a/doc/git-unpublish/index.md b/doc/git-unpublish/index.md new file mode 100644 index 00000000..dfa9f43f --- /dev/null +++ b/doc/git-unpublish/index.md @@ -0,0 +1,26 @@ +# git unpublish + +## Unpublish the current branch + +Git alias: + +```git +unpublish = !"git push origin :$(git my-branch)" +``` + +Unpublish the current branch by deleting the +remote version of the current branch. + +Example: + +```shell +$ git unpublish +``` + +Compare: + +* [git publish & git unpublish](../git-publish-git-unpublish) (describes both) + +* [git publish](../git-publish) + +* [git unpublish](../git-unpublish) (this alias) diff --git a/doc/alias/git-untrack/index.md b/doc/git-untrack/index.md similarity index 70% rename from doc/alias/git-untrack/index.md rename to doc/git-untrack/index.md index 1dc2e53c..fb224b12 100644 --- a/doc/alias/git-untrack/index.md +++ b/doc/git-untrack/index.md @@ -1,8 +1,10 @@ # git untrack -## Stop tracking a branch, with default parameters, and showing the command. +## Stop tracking a branch, with default parameters, and show the command -```gitconfig +Git alias: + +```git untrack = "!f(){ \ branch=$(git rev-parse --abbrev-ref HEAD); \ cmd=\"git branch --unset-upstream ${1:-$branch}\"; \ @@ -13,7 +15,7 @@ untrack = "!f(){ \ Example: -```sh +```shell $ git untrack ``` diff --git a/doc/git-unwip/index.md b/doc/git-unwip/index.md new file mode 100644 index 00000000..391ba5f8 --- /dev/null +++ b/doc/git-unwip/index.md @@ -0,0 +1,23 @@ +# git unwip + +## Alias for uncommit "work in progress" + +Git alias: + +```git +unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1" +``` + +Example: + +```shell +$ git unwip +``` + +Compare: + +* [git wip & git unwip](../git-wip-git-unwip) (overview) + +* [git wip](../git-wip) + +* [git unwip](../git-unwip) (this alias) diff --git a/doc/alias/git-upstream-branch/index.md b/doc/git-upstream-branch/index.md similarity index 50% rename from doc/alias/git-upstream-branch/index.md rename to doc/git-upstream-branch/index.md index 05fbfef5..104717ce 100644 --- a/doc/alias/git-upstream-branch/index.md +++ b/doc/git-upstream-branch/index.md @@ -2,13 +2,21 @@ ## Get the upstream branch name -```gitconfig +Git alias: + +```git upstream-branch = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) ``` Example: -```sh +```shell $ git upstream-branch origin/main ``` + +Compare: + +* [git my-branch](../git-my-branch) - Get my current local branch name + +* [git upstream-branch](../git-upstream-branch) - Get the upstream branch name (this alias) diff --git a/doc/alias/git-w/index.md b/doc/git-w/index.md similarity index 58% rename from doc/alias/git-w/index.md rename to doc/git-w/index.md index 35e1c756..0ed67082 100644 --- a/doc/alias/git-w/index.md +++ b/doc/git-w/index.md @@ -1,6 +1,6 @@ # git w -## Shortcut for "whatchanged" +## Short for "git whatchanged" ``` w = whatchanged @@ -8,6 +8,6 @@ w = whatchanged Example: -```sh +```shell $ git w ``` diff --git a/doc/alias/git-whatis/index.md b/doc/git-whatis/index.md similarity index 85% rename from doc/alias/git-whatis/index.md rename to doc/git-whatis/index.md index 9552203e..91a40527 100644 --- a/doc/alias/git-whatis/index.md +++ b/doc/git-whatis/index.md @@ -2,12 +2,14 @@ ## Given a git object, try to show it briefly -```gitconfig +Git alias: + +```git whatis = show --no-patch --pretty='tformat:%h (%s, %ad)' --date=short ``` Example: -```sh +```shell $ git whatis ``` diff --git a/doc/alias/git-who/index.md b/doc/git-who/index.md similarity index 85% rename from doc/alias/git-who/index.md rename to doc/git-who/index.md index d64acda5..be0ee211 100644 --- a/doc/alias/git-who/index.md +++ b/doc/git-who/index.md @@ -2,12 +2,14 @@ ## Show a short log of who has contributed commits, in descending order -```gitconfig +Git alias: + +```git who = shortlog --summary --email --numbered --no-merges ``` Example: -```sh +```shell $ git who ``` diff --git a/doc/alias/git-whois/index.md b/doc/git-whois/index.md similarity index 87% rename from doc/alias/git-whois/index.md rename to doc/git-whois/index.md index d30c1ee7..aa79a188 100644 --- a/doc/alias/git-whois/index.md +++ b/doc/git-whois/index.md @@ -1,14 +1,16 @@ # git whois -## Given a string for an author, try to figure out full name and email. +## Given a string for an author, try to figure out full name and email -```gitconfig +Git alias: + +```git whois = "!sh -c 'git log --regexp-ignore-case -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -" ``` Example: -```sh +```shell $ git whois alice Alice Adams ``` diff --git a/doc/alias/git-wip-git-unwip/index.md b/doc/git-wip-git-unwip/index.md similarity index 87% rename from doc/alias/git-wip-git-unwip/index.md rename to doc/git-wip-git-unwip/index.md index f1f3c5e1..cb40d660 100644 --- a/doc/alias/git-wip-git-unwip/index.md +++ b/doc/git-wip-git-unwip/index.md @@ -1,11 +1,21 @@ # git wip & git unwip -## Helpers for "work in progress" +## Aliases for "work in progress" + + +Git alias: + +```git +wip = !"git add --all; git ls-files --deleted -z | xargs -0 git rm; git commit --message=wip" + +unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1" +``` Example: -```sh +```shell $ git wip + $ git unwip ``` @@ -18,15 +28,3 @@ The unwip alias is a quick way to restore deleted files to the working tree. From https://gist.github.com/492227 and VonC on stackoverflow. -```gitconfig -wip = !"git add --all; git ls-files --deleted -z | xargs -0 git rm; git commit --message=wip" - -unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1" -``` - -Example: - -```sh -$ git wip -$ git unwip -``` diff --git a/doc/git-wip/index.md b/doc/git-wip/index.md new file mode 100644 index 00000000..9f45fb8d --- /dev/null +++ b/doc/git-wip/index.md @@ -0,0 +1,23 @@ +# git wip + +## Alias for commit "work in progress" + +Git alias: + +```git +wip = !"git add --all; git ls-files --deleted -z | xargs -0 git rm; git commit --message=wip" +``` + +Example: + +```shell +$ git wip +``` + +Compare: + +* [git wip & git unwip](../git-wip-git-unwip) (overview) + +* [git wip](../git-wip) (this alias) + +* [git unwip](../git-unwip) diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..78569654 --- /dev/null +++ b/doc/index.html @@ -0,0 +1,689 @@ + + + + + + Git Alias - GitAlias + + + + + + + + + +
+

Git Alias

+

This project provides many git alias commands that you can use as you like.

+ +

Contents on this page:

+ +

Letter aliases

+

Letter aliases are for frequent commands:

+ +

Short aliases

+

Short aliases are for frequent commands and options:

+

git add:

+ +

git branch:

+
    +
  • git b = branch
  • +
  • git bm = branch –merged
  • +
  • git bnm = branch –no-merged
  • +
  • git bed = branch –edit-description
  • +
  • git bsd = branch –show-description (polyfill)
  • +
+

git commit:

+ +

git checkout:

+ +

git cherry-pick:

+
    +
  • git cp = cherry-pick
  • +
  • git cpa = cherry-pick –abort
  • +
  • git cpc = cherry-pick –continue
  • +
  • git cpn = cherry-pick -n (–no-commit)
  • +
  • git cpnx = cherry-pick -n -x (–no-commit and with a message)
  • +
+

git diff:

+ +

git grep:

+
    +
  • git g = grep
  • +
  • git gg = grep with our preferred settings
  • +
  • git gn = grep -n (–line-number)
  • +
+

git log:

+ +

git ls-files:

+
    +
  • git ls = ls-files
  • +
  • git lsd = ls-files –debug
  • +
  • git lsfn = ls-files –full-name
  • +
  • git lsio = ls-files –ignored –others –exclude-standard
  • +
+

git merge:

+ +

git pull:

+
    +
  • git pf - git pull with fast-forward only
  • +
  • git pr - git pull with rebase
  • +
  • git pp - git pull with rebase preserve of merge commits
  • +
+

git rebase:

+ +

git reflog:

+ +

git remote:

+ +

git revert:

+ +

git show-branch:

+ +

git submodule:

+ +

git status:

+ +

Topic branches

+ +

Friendly aliases

+

Start:

+
    +
  • git init-empty - Initialize a repo with an empty rebaseable commit.
  • +
  • git cloner - Clone a repo and recurse on any of its submodules.
  • +
+

Branch names:

+ +

Branch commits:

+ +

List items:

+ +

Undo:

+ +

Convenience alaises

+

Logging & reporting:

+ +

Lookups:

+
    +
  • git whois - Try to figure out an author’s information.
  • +
  • git whatis - Try to figure out an object’s information.
  • +
+

Commit details:

+ +

Add all & edit all:

+ +

Alias helpers:

+ +

Script helpers:

+
    +
  • git top - Get the top level directory name.
  • +
  • git exec - Execute a shell script.
  • +
+

Remotes:

+ +

Misc:

+ +

Advanced aliases:

+ +

Workflow aliases

+

Starting:

+ +

Save:

+
    +
  • git archive - Create an archive file of everything in the repo.
  • +
  • git snapshot - Stash a snapshot of your current working tree.
  • +
  • git panic - When you’re worried the world is coming to an end.
  • +
+

Flow aliases:

+ +

reset & undo:

+
    +
  • git reset-* - Move backwards on the commit chain; synonym for undo-*.
  • +
  • git undo-* - Move backwards on the commit chain; synonym for reset-*.
  • +
+

track & untrack:

+
    +
  • git track - Start tracking from a local branch to upstream branch.
  • +
  • git untrack - Stop tracking from a local branch to upstream branch.
  • +
+

inbound & outbound:

+
    +
  • git inbound - Show incoming changes compared to upstream.
  • +
  • git outbound - Show outgoing changes compared to upstream.
  • +
+

pull1 & push1:

+ +

Cull:

+ +

Maintenance tuning:

+ +

Misc:

+ +

Tooling aliases

+

Use gitk:

+ +

Use other version control systems:

+ +

Use graphviz:

+ +

Index of all aliases

+ + +
+ + + + + diff --git a/doc/index.md b/doc/index.md new file mode 100644 index 00000000..bfd21217 --- /dev/null +++ b/doc/index.md @@ -0,0 +1,672 @@ +# GitAlias + +This project provides many git alias commands that you can use as you like. + +Contents: + +* [What is GitAlias?](#what-is-git-alias) +* [Why use GitAlias?](#why-use-gitalias) +* [Download, install, customize](#download-install-customize) +* [Short aliases](#abbrevation-aliases) +* [Topic aliases](#topic-aliases) +* [Friendly aliases](#friendly-aliases) +* [Convenience alaises](#convenience-alaises) +* [Workflow aliases](#workflow-aliases) +* [Tooling aliases](#tooling-aliases) +* [Index of all aliases](#index-of-all-aliases) +* [Contribute](CONTRIBUTING.md) +* [More ideas](more/index.md) +* [To do](todo/index.md) +* [Thanks](thanks/index.md) +* [Tracking](#tracking) + + +## What is GitAlias? + +GitAlias is a collection of git version control alias helpers: + + * Shortcuts such as [`ss = status --short`](git-ss/index.md), [`ca = commit --amend`](git-ca/index.md), [`lg = log --graph`](git-lg/index.md). + + * Searches such as [`grep-all`](grep-all), [`whois`](git-who/index.md), [`whatis`](git-whatis/index.md). + + * Reports such as [`chart`](git-chart/index.md), [`summary`(git-summary/index.md), [`log-my-week`](git-log-my-week/index.md). + + * Commands such as [`optimizer`](git-optimizer/index.md), [`archive`](git-archive/index.md), [`reincarnate`](reincarnate/index.md). + + * Workflows such as [`get`](git-get/index.md)/[`put`](git-put/index.md), [`publish`](git-publish/index.md)/[`unpublish`](git-unpublish/index.md), [`topic-begin`](git-topic-begin/index.md)/[`topic-end`](git-topic-end/index.md). + + +### Why use GitAlias? + +Because it makes your work faster, more streamlined, and more powerful. + +Because when you work on multiple teams, it's very helpful to count on consistent git aliases. For shorter commands, such as `s` for `status`, fast speed is nice. For longer commands, such as `repacker`, accurate settings are important. + + +## Download, install, customize + +* Download the GitAlias source code all in one file: [gitalias.txt](gitalias.txt) + +* Install GitAlias using a variety of ways: [install guide](install/index.md). + +* Customize the aliases as you wish: [customize guide](customize/index.md). + +You can also follow us on GitHub: + +* GitAlias account: [https://github.com/gitalias](https://github.com/gitalias) + +* GitAlias repository: [https://github.com/gitalias/gitalias](https://github.com/gitalias/gitalias) + + +## Short aliases + +Short aliases are for frequent commands and options: + +git add: + +* [git a](git-a/index.md/index.md) = add +* [git aa](git-aa/index.md) = add --all +* [git ap](git-ap/index.md) = add --patch +* [git au](git-au/index.md) = add --update + +git branch: + +* [git b](git-b/index.md/index.md) = branch +* [git bm](git-bm/index.md) = branch --merged +* [git bnm](git-bnm/index.md) = branch --no-merged +* [git bed](git-bed/index.md) = branch --edit-description +* [git bsd](git-bsd/index.md) = branch --show-description (polyfill) + +git commit: + +* [git c](git-c/index.md/index.md) = commit +* [git ca](git-ca/index.md) = commit --amend +* [git cam](git-cam/index.md) = commit --amend --message +* [git cane](git-cane/index.md) = commit --amend --no-edit +* [git ci](git-ci/index.md) = commit --interactive +* [git cm](git-cm/index.md) = commit --message + +git checkout: + +* [git co](git-co/index.md) = checkout +* [git cog](git-cog/index.md) = checkout --guess +* [git cong](git-cong/index.md) = checkout --no-guess + +git cherry-pick: + +* [git cp](git-cp/index.md) = cherry-pick +* [git cpa](git-cpa/index.md) = cherry-pick --abort +* [git cpc](git-cpc/index.md) = cherry-pick --continue +* [git cpn](git-cpn/index.md) = cherry-pick -n (--no-commit) +* [git cpnx](git-cpnx/index.md) = cherry-pick -n -x (--no-commit and with a message) + +git diff: + +* [git d](git-d/index.md/index.md) = diff +* [git dd](git-dd/index.md) = diff with our preferred settings +* [git dc](git-dc/index.md) = diff --cached +* [git ds](git-ds/index.md) = diff --staged +* [git dwd](git-dwd/index.md) = diff --word-diff + +git fetch: + +* [git f](git-f/index.md/index.md) = fetch + +git grep: + +* [git g](git-g/index.md/index.md) = grep +* [git gg](git-gg/index.md) = grep with our preferred settings +* [git gn](git-gn/index.md) = grep -n (--line-number) + +git log: + +* [git l](git-l/index.md/index.md) = log +* [git ll](git-ll/index.md) = log with our preferred short settings +* [git lll](git-lll/index.md) = log with our preferred long settings +* [git lg](git-lg/index.md) = log --graph +* [git lo](git-lo/index.md) = log --oneline +* [git lor](git-lor/index.md) = log --oneline --reverse +* [git lp](git-lp/index.md) = log --patch +* [git lfp](git-lfp/index.md) = log --first-parent +* [git lto](git-lto/index.md) = log --topo-order + +git ls-files: + +* [git ls](git-ls/index.md) = ls-files +* [git lsd](git-lsd/index.md) = ls-files --debug +* [git lsfn](git-lsfn/index.md) = ls-files --full-name +* [git lsio](git-lsio/index.md) = ls-files --ignored --others --exclude-standard + +git merge: + +* [git m](git-m/index.md/index.md) = merge +* [git ma](git-ma/index.md) = merge --abort +* [git mc](git-mc/index.md) = merge --continue +* [git me](git-me/index.md) = merge --no-commit --no-ff + +git pull: + +* [git pf](git-pf/index.md) - git pull with fast-forward only +* [git pr](git-pr/index.md) - git pull with rebase +* [git pp](git-pp/index.md) - git pull with rebase preserve of merge commits + +git rebase: + +* [git rb](git-rb/index.md) = rebase +* [git rba](git-rb/index.md) = rebase --abort +* [git rbc](git-rbc/index.md) = rebase --continue +* [git rbs](git-rbs/index.md) = rebase --skip +* [git rbi](git-rbi/index.md) = rebase --interactive +* [git rbiu](git-rbiu/index.md) = rebase --interactive @{upstream} + +git reflog: + +* [git rl](git-rl/index.md) = reflog + +git remote: + +* [git rr](git-rr/index.md) = remote +* [git rrs](git-rrs/index.md) = remote show +* [git rru](git-rru/index.md) = remote update +* [git rrp](git-rrp/index.md) = remote prune + +git revert: + +* [git rv](git-rv/index.md) = revert +* [git rvnc](git-rvnc/index.md) = revert --no-commit + +git show-branch: + +* [git sb](git-sb/index.md) = show-branch +* [git sbdo](git-sbdo/index.md) = show-branch --date-order +* [git sbto](git-sbto/index.md) = show-branch --topo-order + +git submodule: + +* [git sm](git-sm/index.md) = submodule +* [git smi](git-smi/index.md) = submodule init +* [git sma](git-sma/index.md) = submodule add +* [git sms](git-sms/index.md) = submodule sync +* [git smu](git-smu/index.md) = submodule update +* [git smui](git-smui/index.md) = submodule update --init +* [git smuir](git-smuir/index.md) = submodule update --init --recursive + +git status: + +* [git s](git-s/index.md/index.md) = status +* [git ss](git-ss/index.md) = status --short +* [git ssb](git-ssb/index.md) = status --short --branch + +git whatchanged: + +* [git w](git-w/index.md/index.md) = whatchanged + + +## Topic aliases + +Topic aliases for creating topic branches, such as to add a feature, fix a bug, document a capabilty, etc. + +* [git topic-*](git-topic/index.md) - Read this first about topic aliases +* [git topic-base](git-topic-base/index.md) - Show the topic base branch name +* [git topic-begin](git-topic-begin/index.md) - Start a new topic branch +* [git topic-end](git-topic-end/index.md) - Finish the current topic branch +* [git topic-sync](git-topic-sync/index.md) - Synchronize the current topic branch +* [git topic-move](git-topic-move/index.md) - Rename the current topic branch + + +## Friendly aliases + +Start: + +* [git init-empty](git-init-empty/index.md) - Initialize a repo with an empty rebaseable commit +* [git cloner](git-cloner/index.md) - Clone a repo and recurse on any of its submodules + +Branch names: + +* [git default-branch](git-default-branch/index.md) - Get the default branch name +* [git my-branch](git-my-branch/index.md) - Get my current local branch name +* [git upstream-branch](git-upstream-branch/index.md) - Get the upstream branch name +* [git topic-base](git-topic-base/index.md) - Get the topic branch name + +Branch commits: + +* [git branch-commit-first](../git-branch-commit-first) - Show a branch's first commit hash (or hashes) +* [git branch-commit-last](../git-branch-commit-last) - Show a branch's last commit hash (or hashes) +* [git branch-commit-prev](../git-branch-commit-prev) - Show a branch's previous commit hash (or hashes) +* [git branch-commit-next](../git-branch-commit-next) - Show a branch's next commit hash (or hashes) + +List items: + +* [git aliases](git-aliases/index.md) - List aliases +* [git branches](git-branches/index.md) - List branches +* [git tags](git-tags/index.md) - List tags +* [git stashes](git-stashes/index.md) - List stashes + +Undo: + +* [git uncommit](git-uncommit/index.md) = reset --soft HEAD~1 +* [git unadd](git-unadd/index.md) = reset HEAD + + +## Convenience alaises + +Logging & reporting: + +* [git log-*](git-log/index.md) (many aliases) +* [git who](git-who/index.md) +* [git chart](git-chart/index.md) +* [git churn](git-churn/index.md) +* [git summary](git-summary/index.md) + +Lookups: + +* [git whois](git-whois/index.md) - Try to figure out an author's information +* [git whatis](git-whatis/index.md) - Try to figure out an object's information + +Commit details: + +* [git commit-parents](git-commit-parents/index.md) - Show the commit's parents +* [git commit-is-merge](git-commit-is-merge/index.md) - Is the commit a merge commit? +* [git commit-message-key-lines](git-commit-message-key-lines/index.md) + +Add all & edit all: + +* [git add-*](git-edit/index.md) - Add all files of a given type +* [git edit-*](git-edit/index.md) - Edit all files of a given type + +Alias helpers: + +* [git add-alias](git-add-alias/index.md) - Create a new git alias +* [git move-alias](git-move-alias/index.md) - Rename an existing git alias + +Script helpers: + +* [git top](git-top/index.md) - Get the top level directory name +* [git exec](git-exec/index.md) - Execute a shell script + +Remotes: + +* [git remotes-prune](git-remotes-prune/index.md) - For each remote branch, prune it +* [git remotes-push](git-remotes-push/index.md) - For each remote branch, push it + +Misc: + +* [git diff-*](git-diff/index.md) +* [git grep-*](git-grep/index.md) +* [git merge-span-*](git-merge-span/index.md) - Merge span aliases +* [git orphans](git-orphans/index.md) - Find all objects that aren't referenced by any other object +* [git fixup](git-fixup/index.md) - Fix a commit by amending it +* [git rev-list-all-objects-by-size](git-rev-list-all-objects-by-size/index.md) +* [git rev-list-all-objects-by-size-and-name](git-rev-list-all-objects-by-size-and-name/index.md) +* [git cherry-pick-merge](git-cherry-pick-merge/index.md) +* [git refs-by-date](git-refs-by-date/index.md) - Sort by date for branches + +Advanced aliases: + +* [git search-commits](git-search-commits/index.md) +* [git debug](git-debug/index.md) +* [git intercommit](git-intercommit/index.md) + + +## Workflow aliases + +Starting: + +* [git init-empty](git-init-empty/index.md) - Initialize a repo with an empty rebaseable commit +* [git cloner](git-cloner/index.md) - Clone a repo and recurse on any of its submodules +* [git clone-lean](git-clone-lean/index.md) - Clone a repo as lean as possible + +Save: + +* [git archive](git-archive/index.md) - Create an archive file of everything in the repo +* [git snapshot](git-snapshot/index.md) - Stash a snapshot of your current working tree +* [git panic](git-panic/index.md) - When you're worried the world is coming to an end + +Flow aliases: + +* [git get & git put](git-get-git-put/index.md) +* [git ours & git theirs](git-ours-git-theirs/index.md) +* [git wip & git unwip](git-wip-git-unwip/index.md) +* [git assume & git unassume](git-assume-and-git-unassume/index.md) +* [git publish & git unpublish](git-publish-git-unpublish/index.md) + +reset & undo: + +* [git reset-*](git-reset/index.md) - Move backwards on the commit chain; synonym for undo-* +* [git undo-*](git-undo/index.md) - Move backwards on the commit chain; synonym for reset-* + +track & untrack: + +* [git track](git-track/index.md) - Start tracking from a local branch to upstream branch +* [git untrack](git-untrack/index.md) - Stop tracking from a local branch to upstream branch + +inbound & outbound: + +* [git inbound](git-inbound/index.md) - Show incoming changes compared to upstream +* [git outbound](git-outbound/index.md) - Show outgoing changes compared to upstream + +pull1 & push1: + +* [git pull1](git-pull1/index.md) - Pull just the one current branch +* [git push1](git-push1/index.md) - Push just the one current branch + +Cull: + +* [git cull](git-cull/index.md) - Delete all branches that are merged +* [git cull-local-branches](git-cull-local-branches/index.md) - Delete local branches that are merged +* [git cull-remote-branches](git-cull-remote-branches/index.md) - Delete remote branches that are merged + +Maintenance tuning: + +* [git cleaner](git-cleaner/index.md) - Clean the recommend way +* [git pruner](git-pruner/index.md) - Prune the recommened way +* [git repacker](git-repacker/index.md) - Repack the recommended way +* [git optimizer](git-optimizer/index.md) - Optimize the recommended way + +Misc: + +* [git issues](git-issues/index.md) - Show issues that are described in commit messages +* [git expunge](git-expunge/index.md) - Use filter-branch to delete a file everywhere +* [git reincarnate](git-reincarnate/index.md) - Kill a branch then create it anew +* [git diff-chunk](git-diff-chunk/index.md) - Do a diff of two chunks in revisions +* [git last-tag](git-last-tag/index.md) - Show the last tag in the current branch +* [git serve](git-serve/index.md) - Serve the local directory via git server daemon +* [git track-all-remote-branches](git-track-all-remote-branches/index.md) - Track all remote branches +* [git cleanout](git-cleanout/index.md) - Clean and discard changes and untracked files in working tree + + +## Tooling aliases + +Use gitk: + +* [git gitk-conflict](git-gitk-conflict/index.md) - Use gitk to show conflicting merge +* [git gitk-history-all](git-history-all/index.md) - Use gitk to show full history + +Use other version control systems: + +* [git cvs-*](git-cvs/index.md) - Use CVS version control +* [git svn-*](git-svn/index.md) - Use Subversion version control + +Use graphviz: + +* [git graphviz](git-graphviz/index.md) - Use graphviz for display + + +## Index of all aliases + + * [git a](git-a/index.md) - Short for "git add" + * [git aa](git-aa/index.md) - Short for "git add --all" - Add all paths + * [git add-alias](git-add-alias/index.md) - Create a new git alias + * [git add-cached](git-add-cached/index.md) - Add cached files + * [git add-deleted](git-add-deleted/index.md) - Add deleted files + * [git add-ignored](git-add-ignored/index.md) - Add ignored files + * [git add-killed](git-add-killed/index.md) - Add killed files + * [git add-modified](git-add-modified/index.md) - Add modified files + * [git add-others](git-add-others/index.md) - Add other files + * [git add-stage](git-add-stage/index.md) - Add stage files + * [git add-unmerged](git-add-unmerged/index.md) - Add unmerged files + * [git aliases](git-aliases/index.md) - List git aliases + * [git ap](git-ap/index.md) - Short for "git add --patch" - Add by patch + * [git archive](git-archive/index.md) - Create an archive file of everything in the repo + * [git assume-all](git-assume-all/index.md) - Assume all files are unchanged + * [git assume](git-assume/index.md) - Assume files are unchanged + * [git assumed](git-assumed/index.md) - Show which files are assumed + * [git au](git-au/index.md) - Short for "git add --update" + * [git b](git-b/index.md) - Short for "git branch" + * [git bed](git-bed/index.md) - Edit the description of a branch + * [git bm](git-bm/index.md) - List branches whose tips are reachable from the specified commit (HEAD if not specified) + * [git bnm](git-bnm/index.md) - List branches whose tips are not reachable from the specified commit (HEAD if not specified) + * [git branch-commit-first](git-branch-commit-first/index.md) - Show a branch's first commit hash (or hashes) + * [git branch-commit-last](git-branch-commit-last/index.md) - Show a branch's last commit hash (or hashes) + * [git branch-commit-next](git-branch-commit-next/index.md) - Show a branch's next commit hash (or hashes) + * [git branch-commit-prev](git-branch-commit-prev/index.md) - Show a branch's previous commit hash (or hashes) + * [git branch](git-branch/index.md) - Aliases related to git branch + * [git branches](git-branches/index.md) - List branches + * [git bsd](git-bsd/index.md) - Show the description of a branch + * [git bv](git-bv/index.md) - List branch information with hash and subject + * [git bvv](git-bvv/index.md) - List branch information with hash and subject and upstream + * [git c](git-c/index.md) - Short for "git commit" + * [git ca](git-ca/index.md) - Amend the tip of the current branch; do not create a new commit + * [git cam](git-cam/index.md) - Amend the tip of the current branch; edit the message + * [git cane](git-cane/index.md) - Amend the tip of the current branch; do not edit the message + * [git chart](git-chart/index.md) - Show a summary chart of activity per author + * [git cherry-pick-merge](git-cherry-pick-merge/index.md) - Cherry pick a merge commit + * [git churn](git-churn/index.md) - Show log of files that have many changes + * [git ci](git-ci/index.md) - Commit interactive + * [git cleaner](git-cleaner/index.md) - Use git clean to make everything pristine + * [git cleanout](git-cleanout/index.md) - Clean and discard changes and untracked files in working tree + * [git clone-lean](git-clone-lean/index.md) - Clone as lean as possible + * [git cloner](git-cloner/index.md) - Clone a repository and recurse on any of its submodules + * [git cm](git-cm/index.md) - Commit with a message + * [git co](git-co/index.md) - Checkout a.k.a. update the working tree to match a branch or paths + * [git commit-is-merge](git-commit-is-merge/index.md) - Is the commit a merge commit? If yes exit 0, else exit 1 + * [git commit-message-key-lines](git-commit-message-key-lines/index.md) - Show the commit's keyword-marker lines + * [git commit-parents](git-commit-parents/index.md) - Show the commit's parents + * [git cong](git-cong/index.md) - Checkout with no guessing + * [git count](git-count/index.md) - + * [git cp](git-cp/index.md) - Cherry-pick - apply the changes introduced by some existing commits; + * [git cpa](git-cpa/index.md) - Abort the cherry-pick process + * [git cpc](git-cpc/index.md) - Continue the cherry-pick process + * [git cpn](git-cpn/index.md) - Cherry-pick with no commit + * [git cpnx](git-cpnx/index.md) - Cherry-pick with no commit and with explanation + * [git cull-branches](git-cull-branches/index.md) - Delete branches that have been merged into the upstream commit + * [git cull-local-branches](git-cull-local-branches/index.md) - Delete local branches that have been merged + * [git cull-remote-branches](git-cull-remote-branches/index.md) - Delete remote branches that have been merged into the upstream commit + * [git my-branch](git-my-branch/index.md) - Get my current local branch name + * [git cvs-e](git-cvs-e/index.md) - CVS export + * [git cvs-i](git-cvs-i/index.md) - CVS import + * [git d](git-d/index.md) - Short for "git diff" + * [git dc](git-dc/index.md) - Diff in order to show changes not yet staged + * [git dd](git-dd/index.md) - Diff deep - show changes with our preferred options + * [git debug](git-debug/index.md) - Help debugging builtins + * [git diff-all](git-diff-all/index.md) - For each diff, call difftool + * [git diff-changes](git-diff-changes/index.md) - Show diff of changes + * [git diff-chunk](git-diff-chunk/index.md) - Show the diff of one chunk + * [git diff-deep](git-diff-deep/index.md) - Diff with deep information using our preferred options, a.k.a. `dd` + * [git diff-staged](git-diff-staged/index.md) - Show diffs that are cached i.e. staged + * [git diff-stat](git-diff-stat/index.md) - Diff with stat + * [git discard](git-discard/index.md) - Discard changes in a file (or a list of files) in working tree + * [git ds](git-ds/index.md) - Show changes about to be commited + * [git dw](git-dw/index.md) - Show changes by word, not line + * [git edit-cached](git-edit-cached/index.md) - Edit cached files + * [git edit-deleted](git-edit-deleted/index.md) - Edit deleted files + * [git edit-ignored](git-edit-ignored/index.md) - Edit ignored files + * [git edit-killed](git-edit-killed/index.md) - Edit killed files + * [git edit-modified](git-edit-modified/index.md) - Edit modified files + * [git edit-others](git-edit-others/index.md) - Edit other files + * [git edit-stage](git-edit-stage/index.md) - Edit stage files + * [git edit-unmerged](git-edit-unmerged/index.md) - Edit unmerged files + * [git exec](git-exec/index.md) - Execute a shell script + * [git expunge](git-expunge/index.md) - Delete a file everywhere + * [git f](git-f/index.md) - Short for "git fetch" + * [git fa](git-fa/index.md) - Fetch all remotes + * [git fav](git-fav/index.md) - Fetch all remotes, with verbose output + * [git fixup](git-fixup/index.md) - Fix a commit by amending it + * [git g](git-g/index.md) - Short for "git grep" + * [git get](git-get/index.md) - Get all changes for the current branch + * [git gg](git-gg/index.md) - Grep group i.e. search with our preferred options + * [git gitk-conflict](git-gitk-conflict/index.md) - Use gitk tool to show conflicting merge + * [git gitk-history-all](git-gitk-history-all/index.md) - Use gitk tool to show full history + * [git gn](git-gn/index.md) - Grep and show line number + * [git graphviz](git-graphviz/index.md) - Use graphviz tool for display + * [git grep-ack](git-grep-ack/index.md) - + * [git grep-all](git-grep-all/index.md) - Find text in any commit ever + * [git grep-group](git-grep-group/index.md) - Find text and group the output lines, a.k.a. `gg` + * [git heads](git-heads/index.md) - Show log of heads + * [git ignore](git-ignore/index.md) - Ignore all untracked files by appending them to ".gitignore" + * [git inbound](git-inbound/index.md) - Show incoming changes compared to upstream + * [git init-empty](git-init-empty/index.md) - Initalize a repo with an empty rebaseable commit + * [git intercommit](git-intercommit/index.md) - Use interdiff to see patch modifications + * [git issues](git-issues/index.md) - List all issues mentioned in commit messages between range of commits + * [git item](git-item/index.md) - + * [git l](git-l/index.md) - Short for "git log" + * [git last-tag](git-last-tag/index.md) - Show the last tag in the current branch + * [git last-tagged](git-last-tagged/index.md) - Show the last annotated tag in all branches + * [git lfp](git-lfp/index.md) - Log with first parent + * [git lg](git-lg/index.md) - Log with a text-based graphical representation of the commit history + * [git ll](git-ll/index.md) - Log love - our preferred way key performance indicators + * [git lll](git-lll/index.md) - Log love long i.e. our preferred key performance indicators + * [git lo](git-lo/index.md) - Log with one line per item + * [git log-1-day](git-log-1-day/index.md) - Show log with the recent day + * [git log-1-hour](git-log-1-hour/index.md) - Show log with the recent hour + * [git log-1-month](git-log-1-month/index.md) - Show log with the recent month + * [git log-1-week](git-log-1-week/index.md) - Show log with the recent week + * [git log-1-year](git-log-1-year/index.md) - Show log with the recent year + * [git log-date-first](git-log-date-first/index.md) - Show the date of the earliest commit, in strict ISO 8601 format + * [git log-date-last](git-log-date-last/index.md) - Show the date of the latest commit, in strict ISO 8601 format + * [git log-fetched](git-log-fetched/index.md) - Show log of fetched commits vs. origin/main + * [git log-fresh](git-log-fresh/index.md) - Show log of new commits after you fetched, with stats, excluding merges + * [git log-graph](git-log-graph/index.md) - + * [git log-like-long](git-log-like-long/index.md) - + * [git log-like](git-log-like/index.md) - + * [git log-my](git-log-my/index.md) - Show log with my own commits by my own user email + * [git log-my-day](git-log-my-day/index.md) - Show log with my own recent day + * [git log-my-hour](git-log-my-hour/index.md) - Show log with my own recent hour + * [git log-my-month](git-log-my-month/index.md) - Show log with my own recent month + * [git log-my-week](git-log-my-week/index.md) - Show log with my own recent week + * [git log-my-year](git-log-my-year/index.md) - Show log with my own recent year + * [git log-of-count-and-day](git-log-of-count-and-day/index.md) - Show log with count and day + * [git log-of-count-and-day-of-week](git-log-of-count-and-day-of-week/index.md) - Show log with count and day of week + * [git log-of-count-and-email](git-log-of-count-and-email/index.md) - Show log with count and email + * [git log-of-count-and-format](git-log-of-count-and-format/index.md) - Show log with count and custom format string + * [git log-of-count-and-format-with-date](git-log-of-count-and-format-with-date/index.md) - Show log with count and custom format string and date + * [git log-of-count-and-hour](git-log-of-count-and-hour/index.md) - Show log with count and hour + * [git log-of-count-and-hour-of-day](git-log-of-count-and-hour-of-day/index.md) - Show log with count and hour of day + * [git log-of-count-and-month](git-log-of-count-and-month/index.md) - Show log with count and month + * [git log-of-count-and-week](git-log-of-count-and-week/index.md) - Show log with count and week + * [git log-of-count-and-week-of-year](git-log-of-count-and-week-of-year/index.md) - Show log with count and week of year + * [git log-of-count-and-year](git-log-of-count-and-year/index.md) - Show log with count and year + * [git log-of-day-and-count](git-log-of-day-and-count/index.md) - Show log with day and count + * [git log-of-day-of-week-and-count](git-log-of-day-of-week-and-count/index.md) - Show log with week and count + * [git log-of-email-and-count](git-log-of-email-and-count/index.md) - Show log with email and count + * [git log-of-format-and-count](git-log-of-format-and-count/index.md) - Show a specific format string and count of log entries + * [git log-of-format-and-count-with-date](git-log-of-format-and-count-with-date/index.md) - Show log with custom format string and count with date + * [git log-of-hour-and-count](git-log-of-hour-and-count/index.md) - Show log with hour and count + * [git log-of-hour-of-day-and-count](git-log-of-hour-of-day-and-count/index.md) - Show log with hour of day and count + * [git log-of-month-and-count](git-log-of-month-and-count/index.md) - Show log with month and count + * [git log-of-week-and-count](git-log-of-week-and-count/index.md) - Show log with week and count + * [git log-of-week-of-year-and-count](git-log-of-week-of-year-and-count/index.md) - Show log with week of year and count + * [git log-of-year-and-count](git-log-of-year-and-count/index.md) - Show log with year and count + * [git log-refs](git-log-refs/index.md) - Show log with commits that are referred by some branch or tag + * [git log-timeline](git-log-timeline/index.md) - + * [git lp](git-lp/index.md) - Log with patch generation + * [git ls](git-ls/index.md) - List files in the index and the working tree; like Unix "ls" command + * [git lsd](git-lsd/index.md) - List files and show debug information + * [git lsfn](git-lsfn/index.md) - List files and show full name + * [git lsio](git-lsio/index.md) - List files that git is ignoring + * [git lto](git-lto/index.md) - Log with items appearing in topological order + * [git m](git-m/index.md) - Short for "git merge" + * [git ma](git-ma/index.md) - Merge abort i.e. abort the merge process + * [git mainly](git-mainly/index.md) - Make local like main + * [git mc](git-mc/index.md) - Merge continue i.e. continue the merge process + * [git mncnf](git-mncnf/index.md) - Merge with no autocommit, and with no fast-forward + * [git merge-span](git-merge-span/index.md) - Merge span aliases + * [git merge-span-diff](git-merge-span-diff/index.md) - Show the changes that were introduced by a merge + * [git merge-span-difftool](git-merge-span-difftool/index.md) - Show the changes that were introduced by a merge, in your difftool + * [git merge-span-log](git-merge-span-log/index.md) - Find the commits that were introduced by a merge + * [git move-alias](git-move-alias/index.md) - Rename an existing git alias + * [git o](git-o/index.md) - Short for "git checkout" + * [git optimizer](git-optimizer/index.md) - Optimize the repository by pruning and repacking + * [git orphans](git-orphans/index.md) - Find all objects that aren't referenced by any other object + * [git ours](git-ours/index.md) - Checkout our version of a file and add it + * [git outbound](git-outbound/index.md) - Show outgoing changes compared to upstream + * [git p](git-p/index.md) - Short for "git pull" + * [git panic](git-panic/index.md) - When you're a little worried that the world is coming to an end + * [git pf](git-pf/index.md) - Pull if a merge can be resolved as a fast-forward, otherwise fail + * [git pp](git-pp/index.md) - Pull with rebase preserve of merge commits + * [git pr](git-pr/index.md) - Pull with rebase i.e. provide a cleaner, linear, bisectable history + * [git pruner](git-pruner/index.md) - Prune everything that is unreachable now + * [git publish](git-publish/index.md) - Publish the current branch + * [git pull1](git-pull1/index.md) - Pull just the current branch + * [git push1](git-push1/index.md) - Push just the current branch + * [git pushy](git-pushy/index.md) - Push with force and lease + * [git put](git-put/index.md) - Put all changes for the current branch + * [git rb](git-rb/index.md) - Short for "git rebase" + * [git rba](git-rba/index.md) - Rebase abort i.e. abort the rebase process + * [git rbc](git-rbc/index.md) - Rebase continue i.e. continue the rebase process + * [git rbi](git-rbi/index.md) - Rebase interactive i.e. do a rebase with prompts + * [git rbiu](git-rbiu/index.md) - Rebase interactive on unpushed commits + * [git rbs](git-rbs/index.md) - Rebase skip i.e. restart the rebase process by skipping the current patch + * [git rebase-branch](git-rebase-branch/index.md) - Interactively rebase all the commits on the current branch + * [git rebase-recent](git-rebase-recent/index.md) - Rebase recent commits with interactive + * [git ref-recent](git-ref-recent/index.md) - + * [git refs-by-date](git-refs-by-date/index.md) - Show refs sorted by date for branches + * [git reincarnate](git-reincarnate/index.md) - Delete a branch then create it anew + * [git remote-ref](git-remote-ref/index.md) - TODO + * [git remotes-prune](git-remotes-prune/index.md) - For each remote branch, prune it + * [git remotes-push](git-remotes-push/index.md) - For each remote branch, push it + * [git repacker](git-repacker/index.md) - Repack a repo as recommended by Linus + * [git reset-commit](git-reset-commit/index.md) - Reset a commit with a soft reset + * [git reset-commit-hard](git-reset-commit-hard/index.md) - Reset a commit with a hard reset + * [git reset-commit-hard-clean](git-reset-commit-hard-clean/index.md) - Reset a commit with a hard reset and a clean + * [git reset-to-pristine](git-reset-to-pristine/index.md) - Reset commits and clean all differences + * [git reset-to-upstream](git-reset-to-upstream/index.md) - Reset commits back to the upstream branch + * [git rev-list-all-objects-by-size-and-name](git-rev-list-all-objects-by-size-and-name/index.md) - List all objects by size in bytes and file name. + * [git rev-list-all-objects-by-size](git-rev-list-all-objects-by-size/index.md) - List all blobs by size in bytes + * [git rl](git-rl/index.md) - Short for "git reflog" + * [git rr](git-rr/index.md) - Short for "git remote" + * [git rrp](git-rrp/index.md) - Remote prune i.e. delete all stale remote-tracking branches under + * [git rrs](git-rrs/index.md) - Remote show i.e. give information about the remote + * [git rru](git-rru/index.md) - remote update i.e. fetch updates for a named set of remotes in the repository as defined by remotes + * [git rv](git-rv/index.md) - Short for "git revert" + * [git rvnc](git-rvnc/index.md) - Revert with no commit i.e. without autocommit + * [git s](git-s/index.md) - Short for "git status" + * [git sb](git-sb/index.md) - Short for "git show-branch" i.e. print a list of branches and their commits + * [git search-commits](git-search-commits/index.md) - Search for a given string in all patches and print commit messages + * [git serve](git-serve/index.md) - Serve the local directory by starting a git server daemon + * [git show-unreachable](git-show-unreachable/index.md) - Show logs of unreachable commits + * [git sm](git-sm/index.md) - Short for "git submodule" + * [git sma](git-sma/index.md) - Submodule add i.e. add a submodule to this repo + * [git smi](git-smi/index.md) - Submodule init i.e. initialize a submodule in this repo + * [git sms](git-sms/index.md) - Submodule sync i.e. synchronize a submodule in this repo + * [git smu](git-smu/index.md) - Submodule update i.e. update a submodule in this repo + * [git smui](git-smui/index.md) - Submodule update with initialize + * [git smuir](git-smuir/index.md) - Submodule update with initialize and recursive; this is useful to bring a submodule fully up to date. + * [git snapshot](git-snapshot/index.md) - Take a snapshot of your current working tree + * [git ss](git-ss/index.md) - Status with short format + * [git ssb](git-ssb/index.md) - Status with short format and branch info + * [git stashes](git-stashes/index.md) - List stashes + * [git summary](git-summary/index.md) - Show a helpful summary of some typical metrics + * [git svn-b](git-svn-b/index.md) - Subversion branch + * [git svn-c](git-svn-c/index.md) - Subversion commit + * [git svn-cp](git-svn-cp/index.md) - Subversion cherry pick + * [git svn-m](git-svn-m/index.md) - Subversion merge + * [git tags](git-tags/index.md) - List tags + * [git theirs](git-theirs/index.md) - Checkout their version of a file and add it + * [git top](git-top/index.md) - Get the top level directory name + * [git topic-*](git-topic/index.md) - Read this first about topic aliases + * [git topic-base](git-topic-base/index.md) - Show the project base topic branch name + * [git topic-move](git-topic-move/index.md) - Rename the current topic branch + * [git topic-begin](git-topic-begin/index.md) - Start a new topic branch + * [git topic-end](git-topic-end/index.md) - Finish the current topic branch + * [git topic-sync](git-topic-sync/index.md) - Synchronize the current topic branch by doing updates + * [git track-all-remote-branches](git-track-all-remote-branches/index.md) - Track all remote branches that aren't already being tracked + * [git track](git-track/index.md) - Start tracking a branch, with default parameters, and showing the command + * [git unadd](git-unadd/index.md) - Reset something that's been added + * [git unassume-all](git-unassume-all/index.md) - Unassume all files + * [git unassume](git-unassume/index.md) - Unassume files + * [git uncommit](git-uncommit/index.md) - Reset one commit + * [git undo-commit](git-undo-commit/index.md) - Undo a commit with a soft reset + * [git undo-commit-hard](git-undo-commit-hard/index.md) - Undo a commit with a hard reset + * [git undo-commit-hard-clean](git-undo-commit-hard-clean/index.md) - Undo a commit with a hard reset and a clean + * [git undo-to-pristine](git-undo-to-pristine/index.md) - Undo commits and clean all differences + * [git undo-to-upstream](git-undo-to-upstream/index.md) - Undo commits back to the upstream branch + * [git unpublish](git-unpublish/index.md) - Unpublish the current branch + * [git untrack](git-untrack/index.md) - Stop tracking a branch, with default parameters, and show the command + * [git unwip](git-unwip/index.md) - Load "work in progress" + * [git upstream-branch](git-upstream-branch/index.md) - Get the upstream branch name + * [git w](git-w/index.md) - Short for "git whatchanged" + * [git whatis](git-whatis/index.md) - Given a git object, try to show it briefly + * [git who](git-who/index.md) - Show a short log of who has contributed commits, in descending order + * [git whois](git-whois/index.md) - Given a string for an author, try to figure out full name and email + * [git wip](git-wip/index.md) - Save "work in progress" + + +### Tracking + + * Package: gitalias + * Version: 27.0.0 + * Created: 2016-06-17T22:05:43Z + * Updated: 2022-01-09T19:00:32Z + * License: GPL-2.0-or-later or contact us for custom license + * Contact: Joel Parker Henderson (joel@joelparkerhenderson.com) diff --git a/doc/index/index.md b/doc/index/index.md deleted file mode 100644 index 73cd6cd1..00000000 --- a/doc/index/index.md +++ /dev/null @@ -1,4 +0,0 @@ -title = "Git Alias" -sort_by = "name" -template = "base.html" -page_template = "base.html" diff --git a/doc/install/install.md b/doc/install/index.md similarity index 92% rename from doc/install/install.md rename to doc/install/index.md index 983bd4ac..0941d5f8 100644 --- a/doc/install/install.md +++ b/doc/install/index.md @@ -1,5 +1,3 @@ -page_template = "base.html" - # Install @@ -7,7 +5,7 @@ page_template = "base.html" Download the file [`gitalias.txt`](gitalias.txt) and include it: -```sh +```shell curl https://raw.githubusercontent.com/GitAlias/gitalias/main/gitalias.txt -o ~/.gitalias git config --global include.path ~/.gitalias ``` @@ -17,13 +15,13 @@ git config --global include.path ~/.gitalias Download the file [`gitalias.txt`](gitalias.txt) any way you want, such as: -```sh +```shell curl -O https://raw.githubusercontent.com/GitAlias/gitalias/main/gitalias.txt ``` Manually edit your git config dot file any way you want, such as: -```sh +```shell vi ~/.gitconfig ``` diff --git a/doc/introduction/introduction.md b/doc/introduction/index.md similarity index 90% rename from doc/introduction/introduction.md rename to doc/introduction/index.md index d91a7c8b..bdbb2d02 100644 --- a/doc/introduction/introduction.md +++ b/doc/introduction/index.md @@ -1,5 +1,3 @@ -page_template = "base.html" - # Introduction @@ -11,7 +9,7 @@ Git Alias is a collection of git version control shortcuts, functions, and comma * Improvements such as `optimize` to do a prune and repack with recommended settings. - * Workflows such as `topic-start` to create a new topic branch for a new feature. + * Workflows such as `topic-begin` to create a new topic branch for a new feature. * Visualizations such as `graphviz` to show logs and charts using third-party tools. diff --git a/doc/more/more.md b/doc/more/index.md similarity index 89% rename from doc/more/more.md rename to doc/more/index.md index 66d4599d..7bec05df 100644 --- a/doc/more/more.md +++ b/doc/more/index.md @@ -1,8 +1,6 @@ -page_template = "base.html" +# More ideas -# Resources - -More ideas for git improvements: +For more ideas for git improvements: * If you want to alias the git command, then use your shell, such as `alias g=git`. @@ -18,7 +16,7 @@ More ideas for git improvements: * If you use `node` then see [git-alias](https://www.npmjs.com/package/git-alias) -For more git config ideas, and for credit for many of the aliases here, please see these excelent resources: +For more ideas for git config, and for credit for many of the aliases here, please see these excelent resources: * @@ -40,7 +38,7 @@ For more git config ideas, and for credit for many of the aliases here, please s * [Human Git Aliases](http://gggritso.com/human-git-aliases) -References: +For more ideas for references: * [Git Basics - Git Aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases) diff --git a/doc/site/templates/template.html b/doc/site/templates/template.html new file mode 100644 index 00000000..24cf6546 --- /dev/null +++ b/doc/site/templates/template.html @@ -0,0 +1,38 @@ + + + + + + {{title}} - GitAlias + + + + + + + + +
+ {{content}} +
+ + + + + diff --git a/doc/thanks/thanks.md b/doc/thanks/index.md similarity index 96% rename from doc/thanks/thanks.md rename to doc/thanks/index.md index 5d405b4f..2507b584 100644 --- a/doc/thanks/thanks.md +++ b/doc/thanks/index.md @@ -1,8 +1,6 @@ -page_template = "base.html" - # Thanks -Thanks to all the contributors, including all the creators of the projects mentioned above. +Thanks to all the contributors, including all the creators of the projects described here. Thanks to these people for extra help, in order of participation: diff --git a/doc/todo/todo.md b/doc/todo/index.md similarity index 95% rename from doc/todo/todo.md rename to doc/todo/index.md index 4fc4fb66..7d9591cb 100644 --- a/doc/todo/todo.md +++ b/doc/todo/index.md @@ -1,5 +1,3 @@ -page_template = "base.html" - # To do list To do list in priority order: diff --git a/gitalias.txt b/gitalias.txt index e4bbee84..2ad103ca 100644 --- a/gitalias.txt +++ b/gitalias.txt @@ -1,7 +1,8 @@ # -*- mode: gitconfig; -*- # vim: set filetype=gitconfig: + ## -# GitAlias.com file of many git alias items, including shortcuts, +# GitAlias.com collection of many git alias items, including shortcuts, # helpers, workflows, utilties, visualizers, reports, etc. # # @@ -56,17 +57,17 @@ # ## Tracking # # * Package: gitalias -# * Version: 26.0.0 -# * Created: 2016-06-17T00:00:00Z -# * Updated: 2021-10-16T16:41:08Z -# * License: GPL-2.0-only +# * Version: 27.0.0 +# * Created: 2016-06-17T22:05:43Z +# * Updated: 2022-01-03T15:56:43Z +# * License: GPL-2.0-only or contact us for custom license # * Contact: Joel Parker Henderson (joel@joelparkerhenderson.com) ## [alias] ## - # One letter alias for our most frequent commands. + # Short aliases for frequent commands. # # Guidelines: these aliases do not use options, because we want # these aliases to be easy to compose and use in many ways. @@ -86,12 +87,12 @@ w = whatchanged ## - # Short aliases for our frequent commands. + # Short aliases for frequent commands and options. ## - ### add ### + ### add aliases ### - # add all + ## add all aa = add --all # add by patch - looks at each change, and asks if we want to put it in the repo. @@ -100,7 +101,7 @@ # add just the files that are updated. au = add --update - ### branch ### + ### branch aliases ### # branch and only list branches whose tips are reachable from the specified commit (HEAD if not specified). bm = branch --merged @@ -117,15 +118,15 @@ git config \"branch.$branch.description\"; \ };f" - # branch verbose: When in list mode, show sha1, commit subject line, relationship, etc. + # branch verbose: When in list mode, show the hash, the commit subject line, etc. # This is identical to doing `git b -v`. bv = branch --verbose - # branch verbose x2: When in list mode, show path, upstream branch, etc. + # branch verbose verbose: When in list mode, show the hash the commit subject line, the upstream branch, etc. # This is identical to doing `git b -vv`. bvv = branch --verbose --verbose - ### commit ### + ### commit aliases ### # commit - amend the tip of the current branch rather than creating a new commit. ca = commit --amend @@ -142,13 +143,13 @@ # commit with a message cm = commit --message - ### checkout ### + ### checkout aliases ### # checkout - update the working tree to match a branch or paths. [same as "o" for "out"] co = checkout cong = checkout --no-guess - ### cherry-pick ### + ### cherry-pick aliases ### # cherry-pick - apply the changes introduced by some existing commits; useful for moving small chunks of code between branches. cp = cherry-pick @@ -165,7 +166,7 @@ # cherry-pick --no-commit a.k.a. without making a commit, and when when recording the commit, append a line that says "(cherry picked from commit ...)" cpnx = cherry-pick -n -x - ### diff ### + ### diff aliases ### # diff - show changes not yet staged dc = diff --cached @@ -179,7 +180,7 @@ # diff deep - show changes with our preferred options. Also aliased as `diff-deep`. dd = diff --check --dirstat --find-copies --find-renames --histogram --color - ### fetch ### + ### fetch aliases ### # fetch all - fetch all remotes. fa = fetch --all @@ -187,7 +188,7 @@ # fetch all verbose - fetch all remotes, with verbose output. fav = fetch --all --verbose - ### grep ### + ### grep aliases ### # grep i.e. search for text g = grep @@ -198,7 +199,7 @@ # grep group - search with our preferred options. Also aliased as `grep-group`. gg = grep --break --heading --line-number --color - ### log ### + ### log aliases ### # log with a text-based graphical representation of the commit history. lg = log --graph @@ -206,6 +207,9 @@ # log with one line per item. lo = log --oneline + # log with one line per item, in reverse order i.e. recent items first. + lor = log --oneline --reverse + # log with patch generation. lp = log --patch @@ -221,7 +225,7 @@ # log like long - we like this summarization our key performance indicators. Also aliased as `log-like-long`. lll = log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --abbrev=40 --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset' - ## ls-files ## + ### ls-files aliases ### # ls-files - show information about files in the index and the working tree; like Unix "ls" command. ls = ls-files @@ -247,7 +251,7 @@ # lsio = ls-files --ignored --others --exclude-standard - ### merge ### + ### merge aliases ### # merge abort - cancel the merging process ma = merge --abort @@ -256,9 +260,9 @@ mc = merge --continue # merge but without autocommit, and with a commit even if the merge resolved as a fast-forward. - me = merge --no-commit --no-ff + mncnf = merge --no-commit --no-ff - ### pull ### + ### pull aliases ### # pull if a merge can be resolved as a fast-forward, otherwise fail. pf = pull --ff-only @@ -338,7 +342,7 @@ # pp = pull --rebase=preserve - ### rebase ### + ### rebase aliases ### # rebase - forward-port local commits to the updated upstream head. rb = rebase @@ -390,12 +394,12 @@ # This is a slightly modified version fixup = "!f() { TARGET=$(git rev-parse \"$1\"); git commit --fixup=$TARGET && GIT_EDITOR=true git rebase --interactive --autosquash $TARGET~; }; f" - ### reflog ### + ### reflog aliases ### # reflog - reference log that manages when tips of branches are updated. rl = reflog - ### remote ### + ### remote aliases ### # remote - manage set of tracked repositories [same as "r"]. rr = remote @@ -409,7 +413,7 @@ # remote prune - deletes all stale remote-tracking branches under . rrp = remote prune - ### revert ### + ### revert aliases ### # revert - undo the changes from some existing commits rv = revert @@ -417,12 +421,12 @@ # revert without autocommit; useful when you're reverting more than one commits' effect to your index in a row. rvnc = revert --no-commit - ### show-branch ### + ### show-branch aliases ### # show-branch - print a list of branches and their commits. sb = show-branch - ### submodule ### + ### submodule aliases ### # submodule - enables foreign repositories to be embedded within a dedicated subdirectory of the source tree. sm = submodule @@ -445,7 +449,7 @@ # submodule update with initialize and recursive; this is useful to bring a submodule fully up to date. smuir = submodule update --init --recursive - ### status ### + ### status aliases ### # status with short format instead of full details ss = status --short @@ -453,7 +457,7 @@ # status with short format and showing branch and tracking info. ssb = status --short --branch - ### ALIAS MANAGEMENT ### + ### alias management aliases ### # git add-alias: create a new git alias. add-alias = "!f() { \ @@ -501,15 +505,15 @@ };f" # Last tag in the current branch - lasttag = describe --tags --abbrev=0 + last-tag = describe --tags --abbrev=0 - # Latest annotated tag in all branches - lasttagged = !git describe --tags `git rev-list --tags --max-count=1` + # Last annotated tag in all branches + last-tagged = !git describe --tags `git rev-list --tags --max-count=1` # From https://gist.github.com/492227 heads = !"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-* ### + ### diff-* aliases ### diff-all = !"for name in $(git diff --name-only $1); do git difftool $1 $name & done" diff-changes = diff --name-status -r @@ -519,7 +523,7 @@ # Diff using our preferred options. A.k.a. `dd`. diff-deep = diff --check --dirstat --find-copies --find-renames --histogram --color - ### grep-* ### + ### grep-* aliases ### # Find text in any commit ever. grep-all = !"f() { git rev-list --all | xargs git grep \"$@\"; }; f" @@ -534,12 +538,14 @@ -c color.grep.match=\"reverse yellow\" \ grep --break --heading --line-number - ### init ### + ### init-* aliases ### - # initalize a repo and immediate add an empty commit, which makes rebase easier. + # Initalize a repo and immediately add an empty rebaseable commit. + # This initialization makes it easier to do later git rebase commands, + # because it enables a rebase to go all the way back to the first commit. init-empty = !"f() { git init && git commit --allow-empty --allow-empty-message --message ''; }; f" - ### merge-* ### + ### merge-span-* aliases ### # Given a merge commit, find the span of commits that exist(ed). # Not so useful in itself, but used by other aliases. @@ -578,10 +584,7 @@ # By [raphinesse](https://stackoverflow.com/users/380229/raphinesse) rev-list-all-objects-by-size-and-name = !"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" - ### LOG ALIASES ### - - # Show log of changes, most recent first - log-changes = log --oneline --reverse + ### log-* aliases ### # Show log of new commits after you fetched, with stats, excluding merges log-fresh = log ORIG_HEAD.. --stat --no-merges @@ -592,29 +595,26 @@ # Show log in our preferred format for our key performance indicators, with long items. A.k.a. `lll`. log-like-long = log --graph --topo-order --date=iso8601-strict --no-abbrev-commit --decorate --all --boundary --pretty=format:'%Cgreen%ad %Cred%h%Creset -%C(yellow)%d%Creset %s %Cblue[%cn <%ce>]%Creset %Cblue%G?%Creset' - # Show log with dates in our local timezone - log-local = log --date=local - - # Show the log for my own commits by my own user email + # Show log for my own commits by my own user email log-my = !git log --author $(git config user.email) # Show log as a graph log-graph = log --graph --all --oneline --decorate - # Show the date of the earliest commit, in strict ISO 8601 format - log-first-date = !"git log --date-order --format=%cI | tail -1" + # Show the date of the first (a.k.a. earliest) commit, in strict ISO 8601 format + log-date-first = !"git log --date-order --format=%cI | tail -1" - # Show the date of the latest commit, in strict ISO 8601 format - log-latest-date = log -1 --date-order --format=%cI + # Show the date of the last (a.k.a. latest) commit, in strict ISO 8601 format + log-date-last = log -1 --date-order --format=%cI - # Show the log of the recent hour, day, week, month, year - log-hour = log --since=1-hour-ago - log-day = log --since=1-day-ago - log-week = log --since=1-week-ago - log-month = log --since=1-month-ago - log-year = log --since=1-year-ago + # Show log with the recent hour, day, week, month, year + log-1-hour = log --since=1-hour-ago + log-1-day = log --since=1-day-ago + log-1-week = log --since=1-week-ago + log-1-month = log --since=1-month-ago + log-1-year = log --since=1-year-ago - # Show the log of my own recent hour, day, week, month, year + # Show log with my own recent hour, day, week, month, year log-my-hour = !git log --author $(git config user.email) --since=1-hour-ago log-my-day = !git log --author $(git config user.email) --since=1-day-ago log-my-week = !git log --author $(git config user.email) --since=1-week-ago @@ -750,7 +750,7 @@ # churn: show log of files that have many changes # - # * Written by (Corey Haines)[http://coreyhaines.com/] + # * Written by [Corey Haines](http://coreyhaines.com/) # * Scriptified by Gary Bernhardt # * Obtained from https://github.com/garybernhardt/dotfiles/blob/main/bin/git-churn # * Edited for GitAlias.com repo by Joel Parker Henderson @@ -820,7 +820,7 @@ printf \"\nMost-active files, with churn count\n\"; git churn | head -7; \ }; f" - ### SHOW COMMIT HASHES VIA ORDERING ### + ### branch-commit-* aliases to show hashes via sort order ### # Show a branch's commit hash (or multiple hashes) # by using ordering keywords ("first" or "last"): @@ -867,7 +867,7 @@ # git branch-commit-first foo 3 # branch-commit-first = "!f() { \ - branch="${1:-$(git current-branch)}"; \ + branch="${1:-$(git my-branch)}"; \ count="${2:-1}"; \ git log --reverse --pretty=%H "$branch" | \ head -"$count"; \ @@ -900,7 +900,7 @@ # git branch-commit-last foo 3 # branch-commit-last = "!f() { \ - branch="${1:-$(git current-branch)}"; \ + branch="${1:-$(git my-branch)}"; \ count="${2:-1}"; \ git log --pretty=%H "$branch" | \ head -"$count"; \ @@ -933,7 +933,7 @@ # git branch-commit-prev foo 3 # branch-commit-prev = "!f() { \ - branch="${1:-$(git current-branch)}"; \ + branch="${1:-$(git my-branch)}"; \ count="${2:-1}"; \ git log --pretty=%H "$branch" | \ grep -A "$count" $(git rev-parse HEAD) | \ @@ -967,18 +967,18 @@ # git branch-commit-next foo 3 # branch-commit-next = "!f() { \ - branch="${1:-$(git current-branch)}"; \ + branch="${1:-$(git my-branch)}"; \ count="${2:-1}"; \ git log --reverse --pretty=%H "$branch" | \ grep -A "$count" $(git rev-parse HEAD) | \ tail +2; \ }; f" - ### REF ALIASES ### + ### ref-* aliases ### ref-recent = "!git for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short) %(objectname:short) %(contents:subject)' refs/heads/" - ### LOOKUP ALIASES ### + ### Lookup aliases ### # whois: given a string for an author, try to figure out full name and email: whois = "!sh -c 'git log --regexp-ignore-case -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -" @@ -1052,7 +1052,7 @@ commit-message-key-lines = "!f(){ echo \"Commit: $1\"; git log \"$1\" --format=fuller | grep \"^[[:blank:]]*[[:alnum:]][-[:alnum:]]*:\" | sed \"s/^[[:blank:]]*//; s/:[[:blank:]]*/: /\"; }; f" - ### WORKFLOW ALIASES ### + ### Workflow aliases ### # Clone a git repository including all submodules cloner = clone --recursive @@ -1128,7 +1128,7 @@ # # git config pull.rebase preserve # - # TODO: handle tags, delete superfluous branches, and add error handing. + # TODO: handle tags, and delete superfluous branches, and add error handing. # get = !git fetch --prune && git pull --rebase && git submodule update --init --recursive put = !git commit --all && git push @@ -1143,8 +1143,8 @@ ignore = "!git status | grep -P \"^\\t\" | grep -vF .gitignore | sed \"s/^\\t//\" >> .gitignore" # Do a push/pull for just one branch - push1 = "!git push origin $(git current-branch)" - pull1 = "!git pull origin $(git current-branch)" + push1 = "!git push origin $(git my-branch)" + pull1 = "!git pull origin $(git my-branch)" # Track and untrack, with default parameters, and with printing the command track = "!f(){ branch=$(git rev-parse --abbrev-ref HEAD); cmd=\"git branch $branch -u ${1:-origin}/${2:-$branch}\"; echo $cmd; $cmd; }; f" @@ -1155,22 +1155,23 @@ # better code that works using more-specific git commands. track-all-remote-branches = !"f() { git branch -r | grep -v ' -> ' | sed 's/^ \\+origin\\///' ; }; f" - ## - # Reset & Undo - ## + ### reset-* & undo-* ### # Reset and undo aliases are ways to move backwards on the commit chain. - # We find that novices prefer the wording "undo"; experts prefer "reset". + # In our experience, novice users tend to prefer the wording with "undo", + # and expert users tend to prefer the wording with "reset". + + # Reset commits reset-commit = reset --soft HEAD~1 reset-commit-hard = reset --hard HEAD~1 - reset-commit-clean = !git reset --hard HEAD~1 && git clean -fd + reset-commit-hard-clean = !git reset --hard HEAD~1 && git clean -fd reset-to-pristine = !git reset --hard && git clean -ffdx reset-to-upstream = !git reset --hard $(git upstream-branch) # Undo is simply a synonym for "reset" because "undo" can help novices. undo-commit = reset --soft HEAD~1 undo-commit-hard = reset --hard HEAD~1 - undo-commit-clean = !git reset --hard HEAD~1 && git clean -fd + undo-commit-hard-clean = !git reset --hard HEAD~1 && git clean -fd undo-to-pristine = !git reset --hard && git clean -ffdx undo-to-upstream = !git reset --hard $(git upstream-branch) @@ -1194,6 +1195,8 @@ # This can be useful, for example, when recovering contents of dropped stashes or reset commits. show-unreachable = !"git fsck --unreachable | grep commit | cut -d\" \" -f3 | xargs git log" + ### add-* & edit-* - Handle files by kind ### + # Add all files of the given type add-cached = !"f() { git ls-files --cached | sort -u ; }; git add `f`" add-deleted = !"f() { git ls-files --deleted | sort -u ; }; git add `f`" @@ -1214,42 +1217,54 @@ edit-stage = !"f() { git ls-files --stage | cut -f2 | sort -u ; }; `git var GIT_EDITOR` `f`" edit-unmerged = !"f() { git ls-files --unmerged | cut -f2 | sort -u ; }; `git var GIT_EDITOR` `f`" - # Ours & Theirs - easy merging when you know which files you want + # Ours & Theirs - Easy merging when you know which files you want # # Sometimes during a merge you want to take a file from one side wholesale. # # The following aliases expose the ours and theirs commands which let you # pick a file(s) from the current branch or the merged branch respectively. # - # * ours: checkout our version of a file and add it - # * theirs: checkout their version of a file and add it + # * git ours - Checkout our version of a file and add it + # + # * git theirs - Checkout their version of a file and add it # # N.b. the function is there as hack to get $@ doing # what you would expect it to as a shell user. # + + # Checkout our version of a file and add it. ours = !"f() { git checkout --ours $@ && git add $@; }; f" + + # Checkout their version of a file and add it. theirs = !"f() { git checkout --theirs $@ && git add $@; }; f" - # Work In Progress: from https://gist.github.com/492227 and VonC on stackoverflow. + # Work In Progress - Easy tracking of what you're doing + # + # From https://gist.github.com/492227 and VonC on stackoverflow. + # # This enables a quick way to add all new and modified files to the index, # while cleaning the index from the files removed from the working tree; # this cleaning will facilitate a rebase, because there won't be any conflict # due to an "unclean" working directory (not in sync with the index). - # The unwip will restore the deleted files to the working tree. + + # Add files using the message "wip" wip = !"git add --all; git ls-files --deleted -z | xargs -r -0 git rm; git commit --message=wip" + + # Restore the deleted files to the working tree. unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1" - # Assume + # Assume & Unassume # # Sometimes we want to change a file in a repo, but never check in your edits. # We can't use .gitignore because the file is tracked. We use update-index. # # If you interact with big corporate projects, such as projects in Subversion, - # then you might run into the need to ignore certain files which are under + # then you might run into the need to ignore certain files which are under the # Subversion control, yet you need to modify them but not commit. + # # The assume-unchanged flag comes to the rescue. # - # Suppose we want to edit passwords.txt and for god's sake never check it in: + # Suppose we want to edit passwords.txt and for gosh sake never check it in: # # $ git status # modified passwords.txt @@ -1269,13 +1284,15 @@ # # Thanks to http://durdn.com/blog/2012/11/22/must-have-git-aliases-advanced-examples/ # Thanks to http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/ - + # assume = update-index --assume-unchanged unassume = update-index --no-assume-unchanged assume-all = "!git st -s | awk {'print $2'} | xargs -r git assume" unassume-all = "!git assumed | xargs -r git update-index --no-assume-unchanged" assumed = !"git ls-files -v | grep ^h | cut -c 3-" + ### cull-* ### + # Delete all branches that have already been merged into the main branch. cull-branches = !git cull-local-branches; git cull-remote-branches; @@ -1285,18 +1302,22 @@ # Delete all remote branches that have been merged into the remote main branch. cull-remote-branches = !"git branch --remotes --merged origin/main | sed 's# *origin/##' | grep -v '^main$' | xargs -r -I% git push origin :% 2>&1 | grep --colour=never 'deleted'" + ### publish & unpublish ### + # Publish the current branch by pushing it to the remote "origin", # and setting the current branch to track the upstream branch. - publish = !"git push --set-upstream origin $(git current-branch)" + publish = !"git push --set-upstream origin $(git my-branch)" # Unpublish the current branch by deleting the # remote version of the current branch. - unpublish = !"git push origin :$(git current-branch)" + unpublish = !"git push origin :$(git my-branch)" - # git inbound: show incoming changes with upstream. + ### inbound & outbound ### + + # Show incoming changes with upstream. inbound = !git remote update --prune; git log ..@{upstream} - # git outbound: show outgoing changes with upstream. + # Show outgoing changes with upstream. outbound = log @{upstream}.. # Delete a branch name, then create the same branch name based on main - @@ -1315,13 +1336,13 @@ stashes = stash list - ### SHELL SCRIPTING ALIASES ### + ### Shell scripting aliases ### # Get the top level directory name - top-name = rev-parse --show-toplevel + top = rev-parse --show-toplevel - # Get the current branch name - current-branch = rev-parse --abbrev-ref HEAD + # Get my current local branch name + my-branch = rev-parse --abbrev-ref HEAD # Get the upstream branch name upstream-branch = !git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD) @@ -1390,17 +1411,22 @@ ### ADVANCED ALIASES ### # Search for a given string in all patches and print commit messages. - # Posted by Mikko Rantalainen on StackOverflow. # # Example: search for any commit that adds or removes string "foobar" - # git searchcommits foobar + # + # git search-commits foobar # # Example: search commits for string "foobar" in directory src/lib - # git searchcommits foobar src/lib + # + # git search-commits foobar src/lib # # Example: search commits for "foobar", print full diff of commit with 1 line context - # git searchcommits foobar --pickaxe-all -U1 src/lib - searchcommits = !"f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\"" + # + # git search-commits foobar --pickaxe-all -U1 src/lib + # + # Posted by Mikko Rantalainen on StackOverflow. + # + search-commits = !"f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\"" # A 'debug' alias to help debugging builtins: when debugging builtins, # we use gdb to analyze the runtime state. However, we have to disable @@ -1466,11 +1492,12 @@ # Serve the local directory by starting a git server daemon, so others can pull/push from my machine serve = "-c daemon.receivepack=true daemon --base-path=. --export-all --reuseaddr --verbose" + ########################################################################## + ### Topic branch aliases ########################################################################## - # Git alias settings suitable for topic branches. + # Topic branch aliases which are starting points for your own workflow. # - # These aliases are simple starting points for a simple topic flow. # Lots of people have lots of ideas about how to do various git flows. # # Some people like to use a topic branch for a new feature, or a @@ -1478,7 +1505,7 @@ # # Start work on a new topic branch, which creates your branch: # - # $ git topic-start add-feature-foo + # $ git topic-begin add-feature-foo # # Do work, and optionally sync our changes, which pushes and pulls: # @@ -1486,7 +1513,7 @@ # # Stop work on a topic branch, which deletes your branch: # - # $ git topic-stop + # $ git topic-end # # If you want to move your branch a.k.a. rename it: # @@ -1529,7 +1556,7 @@ # # Example: # - # git topic-start add-feature-foo + # git topic-begin add-feature-foo # # We use this alias to begin work on a new feature, # new task, new fix, new refactor, new optimization, etc. @@ -1549,7 +1576,7 @@ # the team provide feedback on the work-in-progress, and also to # run any automatic tests to verify the branch runs successfully. - topic-start = "!f(){ \ + topic-begin = "!f(){ \ new_branch=\"$1\"; \ old_branch=$(git topic-base); \ git checkout \"$old_branch\"; \ @@ -1562,7 +1589,7 @@ # # Example: # - # git topic-stop + # git topic-end # # We use this alias to complete work on a new feature, # new task, new fix, new refactor, new optimization, etc. @@ -1586,15 +1613,15 @@ # That's fine; it means someone else has already deleted the branch. # To synchronize your branch list, use "git fetch --prune". - topic-stop = "!f(){ \ - new_branch=$(git current-branch); \ + topic-end = "!f(){ \ + new_branch=$(git my-branch); \ old_branch=$(git topic-base); \ if [ \"$new_branch\" = \"$old_branch\" ]; then \ - printf \"You are asking to do git topic-stop,\n\"; \ + printf \"You are asking to do git topic-end,\n\"; \ printf \"but you are not on a new topic branch;\n\"; \ printf \"you are on the base topic branch: $old_branch.\n\"; \ printf \"Please checkout the topic branch that you want,\n\"; \ - printf \"then retry the git topic-stop command.\n\"; \ + printf \"then retry the git topic-end command.\n\"; \ else \ git push; \ git checkout \"$old_branch\"; \ @@ -1621,7 +1648,7 @@ # Customize this alias as you like for your own workflow. topic-sync = "!f(){ \ - new_branch=$(git current-branch); \ + new_branch=$(git my-branch); \ old_branch=$(git topic-base); \ if [ \"$new_branch\" = \"$old_branch\" ]; then \ printf \"You are asking to do git topic-sync,\n\"; \ @@ -1650,13 +1677,15 @@ topic-move = "!f(){ \ new_branch=\"$1\"; \ - old_branch=$(git current-branch); \ + old_branch=$(git my-branch); \ git branch --move \"$old_branch\" \"$new_branch\"; \ git push origin \":$old_branch\" \"$new_branch\"; \ };f" - ########################################################################## + ######################################################################## + ### Integration aliases + ######################################################################## ## # Git aliases suitable for particular software integrations and tooling,