Show git branch in terminal

When working with git, to avoid accidental commit to wrong branch, it will be better if terminal show the branch name you are currently in.

show git branch in terminal

To display “git branch” in terminal, edit .bashrc

Add following code to end of the file.

You will need to restart terminal after making changes to ~/.bashrc file or run

See Git

Need help with Linux Server or WordPress? We can help!

Leave a Reply

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