Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

display branch name in terminal ubuntu

## Add the lines below to your .bashrc file

# Show git branch name
force_color_prompt=yes
color_prompt=yes
parse_git_branch() {
 git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/(1)/'
}
if [ "$color_prompt" = yes ]; then
 PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[01;31m]$(parse_git_branch)[33[00m]$ '
else
 PS1='${debian_chroot:+($debian_chroot)}u@h:w$(parse_git_branch)$ '
fi
unset color_prompt force_color_prompt
Comment

PREVIOUS NEXT
Code Example
Shell :: stop minecraft server command line 
Shell :: how to install deb package on manjaro 
Shell :: how to install mypy 
Shell :: adonis list routes 
Shell :: how to get out of git bash editor 
Shell :: Créer un installateur Windows 
Shell :: set up redux in react 
Shell :: install x centos 7 
Shell :: bun sh install 
Shell :: how to remove nvm 
Shell :: bash vi mode 
Shell :: add git submodule 
Shell :: error installing drivelist npm 
Shell :: git remove cached directory 
Shell :: send files via ssh 
Shell :: installing nmap on kali linux 
Shell :: git fix Large files detected. 
Shell :: how to pull from a particular branch in git 
Shell :: twig install 
Shell :: Clear heroku redis cache 
Shell :: what shell type 
Shell :: error: insufficient permission for adding an object to repository database .git/objects 
Shell :: git commit back in time 
Shell :: bash comment 
Shell :: install docker-compose ec2 
Shell :: insta hack 
Shell :: grep multiple strings 
Shell :: linux chmod remove sticky bit 
Shell :: add role to node kubernetes 
Shell :: ansible sudo pass 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =