From 76ea0c5bc771ee5f09ef9c2cb90ea5e39323e96b Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Wed, 26 Jul 2023 13:52:31 +0200 Subject: Add squash-all command to git This simple command squashes the entire history into a single commit. --- .config/git/config | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.config/git/config b/.config/git/config index 6456797..9b641e7 100644 --- a/.config/git/config +++ b/.config/git/config @@ -1,26 +1,27 @@ [alias] - a = add - b = branch - bc = branch-cleanup - c = commit - ca = commit --amend --reset-author - co = checkout - cob = checkout -b - ct = tag -s - d = diff - fo = fetch origin - l = log --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'%C(6)%ad %C(3)%h%Creset %s %C(7)by %C(2)%ae%C(7):%C(5)%G?' - lg = log --graph --abbrev-commit --decorate --date=relative --all + a = add + b = branch + bc = branch-cleanup + c = commit + ca = commit --amend --reset-author + co = checkout + cob = checkout -b + ct = tag -s + d = diff + fo = fetch origin + l = log --date=format:'%Y-%m-%d %H:%M:%S' --pretty=format:'%C(6)%ad %C(3)%h%Creset %s %C(7)by %C(2)%ae%C(7):%C(5)%G?' + lg = log --graph --abbrev-commit --decorate --date=relative --all mirror-add = ! git remote set-url --add --push origin - p = push - pa = push-all - prev = ! git show "HEAD:$1" - r = rebase --rebase-merges -i - ra = commit --amend --no-edit -a - rc = rebase --continue - s = status -s - t = tag --sort=-v:refname - tr = for-each-ref --sort=taggerdate --format '%(tag)' refs/tags + p = push + pa = push-all + prev = ! git show "HEAD:$1" + r = rebase --rebase-merges -i + ra = commit --amend --no-edit -a + rc = rebase --continue + s = status -s + squash-all = "!f(){ git reset $(git commit-tree HEAD^{tree} \"$@\");};f" + t = tag --sort=-v:refname + tr = for-each-ref --sort=taggerdate --format '%(tag)' refs/tags #[commit] # gpgsign = true -- cgit v1.1