mirror of
https://github.com/kogakure/dotfiles.git
synced 2026-02-03 20:25:30 +00:00
feat: add some useful Git aliases
This commit is contained in:
10
gitconfig
10
gitconfig
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user