Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

show git branch name in terminal mac

## Add the lines below to your .bashrc file
## Tested on Linux only if it works on macOS let me know!!!!

# 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 :: install rvm for ruby 
Shell :: install mongodb on ec2 ubuntu 18.04 
Shell :: wsl storage does not release 
Shell :: speedtest linux console 
Shell :: expo app size 
Shell :: poetry add library 
Shell :: set up ssh for github 
Shell :: linux kill all process of a user 
Shell :: pip install django invalid syntax 
Shell :: NGINX systemd service file 
Shell :: install docker machine ubuntu 
Shell :: git push without password 
Shell :: remove untracked files git 
Shell :: centos monitor network traffic 
Shell :: powershell copy file to remote server 
Shell :: command line of linux os 
Shell :: mac redis cli 
Shell :: install zipalign kali linux 
Shell :: adding this directory to path mac 
Shell :: ngrok sing up 
Shell :: installing flutter_native_splash 
Shell :: npm supertest 
Shell :: bash ls sort by size 
Shell :: how to open files using terminal in ubuntu 
Shell :: how to check raspbian os version 
Shell :: git pull new branch from remote 
Shell :: download git branch 
Shell :: github quick reference 
Shell :: start vagrant 
Shell :: remove image docker 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =