Last active
May 7, 2022 21:54
-
-
Save sanathks/da1ccc6def41b072fb64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function parse_git_dirty() { | |
git diff --quiet --ignore-submodules HEAD 2>/dev/null; [ $? -eq 1 ] && echo "*" | |
} | |
function parse_git_branch() { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" | |
} | |
alias ga="git add ." | |
alias gaa="git add --all" | |
alias gc="git commit -m" | |
alias push='git push origin "$(parse_git_branch)"' | |
alias pull='git pull --rebase origin "$(parse_git_branch)"' | |
alias gs="git status" | |
alias checkout='git checkout' | |
alias gclr="git checkout ." | |
alias gbr="git branch | grep -v "master" | xargs git branch -D" | |
alias cm="git checkout master" | |
alias cb="git checkout -" | |
alias nb="git checkout -b" | |
alias c="git checkout" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment