Last active
August 27, 2020 12:58
-
-
Save johnazariah/8ef121ab098073b48e10 to your computer and use it in GitHub Desktop.
Git Aliases
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
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " |
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] | |
lga = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
lg = lga -20 | |
ca = commit -a | |
ci = commit | |
st = status | |
co = checkout | |
br = branch | |
fop = fetch origin --prune | |
cob = checkout -b | |
rom = rebase origin/main | |
new = !git init && git symbolic-ref HEAD refs/heads/main | |
alias = ! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment