Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash add git branch to prompt

# Git branch in prompt.
parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'
}
export PS1="u@h W[33[32m]$(parse_git_branch)[33[00m] $ "
Comment

add branch to bash-prompt

parse_git_branch() {
     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ (1)/'
}
export PS1="u@h [33[32m]w[33[33m]$(parse_git_branch)[33[00m] $ "
Comment

PREVIOUS NEXT
Code Example
Shell :: git config command 
Shell :: How do I revert a Git repository to a previous commit? 
Shell :: ssh 
Shell :: start grafana server wsl 
Shell :: linux unicode eingeben 
Shell :: git clone different ssh key 
Shell :: rename branch in git 
Shell :: linux awk 
Shell :: umask 
Shell :: copy file from ssh server to local 
Shell :: letencrpt 
Shell :: how to install snapd on ubuntu 
Shell :: nvim config path 
Shell :: debian 10 install jenkins 
Shell :: curl get url https 
Shell :: osx update host file 
Shell :: step5 pgadmin ubuntu 20.04 
Shell :: terraform version command 
Shell :: libssl-dev ubuntu get version 
Shell :: rename files sequentially linux 
Shell :: powershell open current path in explorer 
Shell :: bash ls and pick 2nd column 
Shell :: git command 
Shell :: delete playerprefs with new application install unity 
Shell :: how to run multiple npm scripts parallel 
Shell :: how to use /dev/urandom 
Shell :: vsode zsh 
Shell :: bitnami cert 
Shell :: bash: ./runapp.sh: Permission denied 
Shell :: batch file path 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =