From bbabba32fe33a540c91485a115465cb22e640b24 Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Fri, 6 May 2022 17:41:31 +0200 Subject: [PATCH] Improved aliases in git notes --- knowledge base/git.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/knowledge base/git.md b/knowledge base/git.md index 1f887b1..c0f6474 100644 --- a/knowledge base/git.md +++ b/knowledge base/git.md @@ -578,7 +578,13 @@ Those commands need to be wrapped into a one-line function definition: ```ini [alias] - pull-from-all = "!f() { git remote show | xargs -I{} -P0 -n1 git pull {} ${1-$(git branch --show-current)}; } && f" + new = !sh -c 'git log $1@{1}..$1@{0} "$@"' + pull-from-all = "!f() { \ + git remote show | xargs -I{} -P0 -n1 git pull {} ${1-$(git branch --show-current)}; \ + } && f" + subtree-add = "!f() { \ + git subtree add --prefix $2 $1 master --squash; \ + }; f" ``` ## LFS extension