Show current branch in CLI

You need to put this code in .bashrc file. You can get this file from /home/currentusename/.bashrc in your linux system.
parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' } PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '

Comments

Popular posts from this blog

Magento 2 test data clean using my sql query

Magento 2 upgrade steps