Skip to content

Instantly share code, notes, and snippets.

@jaykava
Created December 11, 2025 18:32
Show Gist options
  • Select an option

  • Save jaykava/eb0160952d57f3d780dc2ed986f523eb to your computer and use it in GitHub Desktop.

Select an option

Save jaykava/eb0160952d57f3d780dc2ed986f523eb to your computer and use it in GitHub Desktop.
git branch display on ubuntu terminal add this on .bashrc
parse_git_branch() {
git branch 2> /dev/null | sed -n -e 's/^\* \(.*\)/\ \(\1\)/p'
}
export PS1="\\[\\e[0;32m\\]\\u@\\h\\[\\e[m\\]:\\[\\e[0;34m\\]\\w\\[\\e[m\\]\\[\\e[0;33m\\]\$(parse_git_branch)\\[\\e[m\\]\\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment