Skip to content

Instantly share code, notes, and snippets.

@RyoJerryYu
Last active July 3, 2023 07:05
Show Gist options
  • Save RyoJerryYu/e71b66fe725fd84adf491688f5de62fa to your computer and use it in GitHub Desktop.
Save RyoJerryYu/e71b66fe725fd84adf491688f5de62fa to your computer and use it in GitHub Desktop.
Some Useful Git Alias
[alias]
br = branch
ch = checkout
cr = cherry-pick
tmp = "!git add . && git commit -m 'temp'"
rst = reset head~
masterhead = "!git rev-parse --abbrev-ref origin/HEAD"
prevhead = "!git rev-parse --symbolic-full-name --abbrev-ref=loose @{-1}"
up = "!git fetch origin && git rebase $(git masterhead)"
rebi = "!git rebase -i $(git masterhead)"
pub = "!git push origin $(git rev-parse --abbrev-ref HEAD)"
clr = "!git up && git checkout master && git rebase $(git masterhead) && git branch -d $(git prevhead)"
sync = remote update origin --prune
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %C(blue)%s%Creset %C(dim cyan)<%an>%Creset %C(dim white)(%ci)%Creset' --abbrev-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment