Last active
October 15, 2024 08:34
-
-
Save RyoJerryYu/e71b66fe725fd84adf491688f5de62fa to your computer and use it in GitHub Desktop.
Some Useful Git Alias
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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