Horje
show git branch on terminal Code Example
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)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\]$(parse_git_branch)\[\033[00m\]\$ '
else
 PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ '
fi
unset color_prompt force_color_prompt




Shell

Related
Create and edit a new file nano Code Example Create and edit a new file nano Code Example
gitgraken pre-receive hook declined Code Example gitgraken pre-receive hook declined Code Example
Reverse DNS Lookup Code Example Reverse DNS Lookup Code Example
how to install wordpress local Code Example how to install wordpress local Code Example
clone branch in git Code Example clone branch in git Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11