Created
January 16, 2024 18:21
-
-
Save bhavika/5e9640a7679e3594a2a297606688e4c4 to your computer and use it in GitHub Desktop.
ZSH Profile
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
git_current_branch () { | |
local ref | |
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null) | |
local ret=$? | |
if [[ $ret != 0 ]] | |
then | |
[[ $ret == 128 ]] && return | |
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return | |
fi | |
echo ${ref#refs/heads/} | |
} | |
alias gs="git status" | |
alias gp="git pull" | |
alias gpsup='git push --set-upstream origin $(git_current_branch)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment