From c44a47074f3e4e3019c3775fc4c1139441de4216 Mon Sep 17 00:00:00 2001 From: Thek4n Date: Fri, 27 Oct 2023 13:57:39 +0300 Subject: [PATCH] ref(git-config): aliases --- home/user/.config/git/config | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/home/user/.config/git/config b/home/user/.config/git/config index b126563..c73a623 100644 --- a/home/user/.config/git/config +++ b/home/user/.config/git/config @@ -22,10 +22,13 @@ grep = auto ui = auto +[advice] + addEmptyPathspec = false + [alias] - a = "!git status --short | fzf | awk '{print $2}' | xargs git add" - d = "!git diff --color=always | bash -c \"$PAGER\"" - ds = "!git diff --staged --color=always | bash -c \"$PAGER\"" + a = "!git ls-files -m | fzf | xargs git add" + d = diff + ds = diff --staged dno = diff --name-only co = checkout ci = commit @@ -33,20 +36,15 @@ pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)" st = status br = branch - ba = branch -a bm = branch --merged bn = branch --no-merged hist = log --pretty=format:\"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)\" --graph --date=relative --decorate --all --color=always hs = "!git hist | head" - df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}" - llog = log --graph --name-status --pretty=format:\"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset\" --date=relative - open = "!hub browse" + df = "!f() { git log --pretty=format:\"%h %cd [%cn] %s%d\" --date=relative | fzf | awk '{print $1}' | xargs -I {} git diff {}^ {}; }; f" type = cat-file -t dump = cat-file -p - find = "!f() { git log --pretty=format:\"%h %cd [%cn] %s%d\" --date=relative -S'pretty' -S\"$@\" | peco | awk '{print $1}' | xargs -I {} git diff {}^ {}; }; f" unstage = "reset HEAD --" last = log -1 HEAD - branches = branch -avv --list # edit conflicted file on merge edit-unmerged = "!$EDITOR $(git ls-files --unmerged | cut -f2 | sort -u)"