Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

show git branch on terminal on mac

# Git branch in prompt.parse_git_branch() {git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ [1]/'}export PS1="u@h W[33[01;33m]$(parse_git_branch)[33[00m] $ "
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #show #git #branch #terminal #mac
ADD COMMENT
Topic
Name
9+2 =