Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

ubuntu show git branch in terminal

# 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

show git branch on terminal

# 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 :: bash how to create directories in all subdirectories 
Shell :: what is shell scripting 
Shell :: bash loggin as root 
Shell :: Install docker on linux (Ubuntu) 
Shell :: homestead 
Shell :: cmake source directory 
Shell :: fedora docker 
Shell :: chown ubuntu 
Shell :: sudo in mingw64 
Shell :: flutter release mode 
Shell :: ubuntu xampp apache web server running 
Shell :: linux record camera 
Shell :: sudo: add-apt-repository: command not foun 
Shell :: how to install paint.net on linux 
Shell :: xubuntu desktop 
Shell :: how to setup a command that install all npm modules, in subfolders 
Shell :: fortios download linux 
Shell :: extraire 1 image toute le 10 secondes 
Shell :: bash cat file and rewrite it same line 
Shell :: if dos premere un tasto 
Php :: php cors disable 
Php :: laravel image validation 
Php :: WordPress asking for FTP credentials on localhost 
Php :: laravel success message 
Php :: php storage link 
Php :: redirect http to https htaccess laravel 8 
Php :: get the today data laravel 
Php :: __construct 
Php :: get current datatime laravel 
Php :: laravel run php server by ipv4 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =