Skip to content

Instantly share code, notes, and snippets.

@Max95Cohen
Last active January 15, 2023 07:35
Show Gist options
  • Save Max95Cohen/7af5c9db2c003cb0c032265c77a14907 to your computer and use it in GitHub Desktop.
Save Max95Cohen/7af5c9db2c003cb0c032265c77a14907 to your computer and use it in GitHub Desktop.
git.sh
git_branch=$(git branch --show-current 2>&1)
if [[ $git_branch == *"fatal:"* ]]
then export git_branch=''
else export git_branch="$git_branch"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment