Skip to content

Instantly share code, notes, and snippets.

View Davidster's full-sized avatar

David Huculak Davidster

  • Ubisoft
  • Montreal, QC, CA
  • 13:32 (UTC -04:00)
View GitHub Profile
# echo the current git branch if in git repo
function mygitbranch() {
if git status 1> /dev/null 2>&1
then
gsFirstLine="$(git status | head -1)"
echo "${gsFirstLine##* }"
fi
}
# echo '(' if in git repo