Skip to content

Commit

Permalink
config/gitconfig: git aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
n1amr committed Nov 8, 2024
1 parent 277d932 commit 979b625
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions config/gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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)\""
Expand Down Expand Up @@ -68,9 +75,9 @@
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
lp = log-patch
mt = mergetool --tool customVimMergeToolMin
mtv = mergetool --tool customVimMergeTool
nb = new-branch
Expand Down

0 comments on commit 979b625

Please sign in to comment.