Add git branch name to bash prompt

Print Friendly, PDF & Email

By default, git won’t display branch name to terminal prompt. To know which branch you are in, just run git branch command. However, if you want to customise how to display it, please follow some ways to accomplish.

Methods

References

  1. https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt
  2. https://medium.com/fuzzy-code/show-current-git-branch-in-terminal-macos-e319e88046a6
  3. https://stackoverflow.com/questions/17333531/how-can-i-display-the-current-branch-and-folder-path-in-terminal
  4. https://www.codementor.io/tips/8142473421/add-colors-and-show-git-branches-in-your-bash-terminal-osx-

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code

This site uses Akismet to reduce spam. Learn how your comment data is processed.