From 0e03fd2622742cf16d808096009e506cce0b03f3 Mon Sep 17 00:00:00 2001 From: Amr Alaa Date: Fri, 8 Nov 2024 16:47:15 +0200 Subject: [PATCH] config/gitconfig: git aliases --- config/gitconfig | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/config/gitconfig b/config/gitconfig index b2fea777..470b9cb3 100644 --- a/config/gitconfig +++ b/config/gitconfig @@ -25,6 +25,13 @@ init-root = "!f() { git init && git commit --allow-empty -m \"Root Commit\"; }; f" is-clean = "!f() { test -z \"$(git status --short )\"; }; f" is-index-empty = "!f() { test -z \"$(git diff-index --cached --name-only HEAD)\"; }; f" + log-default = "!git log-pretty \"$(git default-branch)..HEAD\"" + log-default-latest = "!git log-pretty \"origin/$(git default-branch)..HEAD\"" + log-default-merge-base = "!git log-pretty \"$(git merge-base \"origin/$(git default-branch)\" HEAD)..HEAD\"" + log-message = log --graph + log-patch = log --graph --patch + log-pretty = log --graph --pretty=longline + log-upstream = log-pretty '@{upstream}..HEAD' new-branch = "!f() { git checkout -B \"$1\" \"${2:-HEAD}\"; git branch --unset-upstream || true; git status; }; f" push-pr = "!f() { git push origin \"HEAD~${1:-0}:refs/heads/$(git current-branch | sed 's/-dev$//')\" -f; }; f" rebase-default = "!git rebase -i \"$(git default-branch)\"" @@ -68,9 +75,10 @@ dfu = diff-upstream f = fetch --all --prune go = "!git-browse" - l = log --graph --pretty=longline - ll = log --graph - lp = log --graph --patch + l = log-pretty + ll = log-message + lmb = log-default-merge-base + lp = log-patch mt = mergetool --tool customVimMergeToolMin mtv = mergetool --tool customVimMergeTool nb = new-branch