Skip to content

Instantly share code, notes, and snippets.

@vesh95
Created January 29, 2020 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vesh95/14bc353767e214ce7fdf62659692b115 to your computer and use it in GitHub Desktop.
Save vesh95/14bc353767e214ce7fdf62659692b115 to your computer and use it in GitHub Desktop.
#показ ветки в командной строке
parse_git_branch() {
if ! git rev-parse --git-dir > /dev/null 2>&1; then
return 0
fi
git_branch=$(git branch 2>/dev/null| sed -n '/^\*/s/^\* //p')
echo "$git_branch"
}
PS1="${debian_chroot:+($debian_chroot)}\e[01;94mbranch:[\$(parse_git_branch)]\e[00m \e[02;31;01mjobs:\j\e[00m \e[01;32m\w\e[00m\n$: "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment