aboutsummaryrefslogtreecommitdiffhomepage
path: root/.config/git/config
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-11-02 00:00:56 +0900
committernsfisis <nsfisis@gmail.com>2025-11-02 00:00:56 +0900
commitc30efdd568efe2ba9f357a115a8c55386b6f55c3 (patch)
tree687fbdf9549595d1316dced4491dded22bc65b72 /.config/git/config
parent1b46dcfd97fbbd8662466a347d778de7b684f021 (diff)
downloaddotfiles-main.tar.gz
dotfiles-main.tar.zst
dotfiles-main.zip
git: add alias "squash-onto"HEADmain
Diffstat (limited to '.config/git/config')
-rw-r--r--.config/git/config9
1 files changed, 9 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config
index d03ee29..555701c 100644
--- a/.config/git/config
+++ b/.config/git/config
@@ -219,3 +219,12 @@
git branch \"$backup_branch\" \"$branch\"; \
fi; \
}; __fn"
+ squash-onto = "!__fn() { \
+ if [ \"$1\" = \"\" ]; then \
+ echo \"usage: git squash-onto <base-ref>\" >&2; \
+ exit 1; \
+ fi; \
+ local base_ref=\"$1\"; \
+ git reset --soft \"$base_ref\" && \
+ git commit --edit -m \"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; \
+ }; __fn"