feat: add some useful Git aliases

This commit is contained in:
Stefan Imhoff
2022-11-11 14:17:49 +01:00
parent de5701437b
commit eeedeee67a

View File

@@ -42,11 +42,21 @@
unmerged = "branch --no-merge"
branches = for-each-ref --sort=-committerdate --format=\"%(color:blue)%(authordate:relative)\t%(color:red)%(authorname)\t%(color:white)%(color:bold)%(refname:short)\" refs/remotes
ignored = "ls-files --others --directory"
# Assume workflow
assume = "update-index --assume-unchanged"
unassume = "update-index --no-assume-unchanged"
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
assumeall = "!git st -s | awk {'print $2'} | xargs git assume"
# Rebase workflow
mainbranch = "!git remote show origin | sed -n '/HEAD branch/s/.*: //p'"
synced = "!git pull origin $(git mainbranch) --rebase"
update = "!git pull origin $(git rev-parse --abbrev-ref HEAD) --rebase"
squash = "!git rebase -v -i $(git mainbranch)"
publish = push origin HEAD --force-with-lease
pub = publish
# GitHub
hub = "!gh repo view --web"
[apply]
whitespace = fix
[color]