Skip to content

Other notes

_gage edited this page Jan 12, 2022 · 2 revisions

Updating bash prompt to show git branch

This bash code runs the git branch command and parses the output for branch name and folder location The PS1 environment variable is updated to uses this information `

branch name in prompt

parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^]/d' -e 's/ (.*)/ (\1)/' }

export PS1="\u@\h [\033[32m]\w[\033[33m]$(parse_git_branch)[\033[00m] $ " `

Virtual box guest additions image to allow for full screen of virtual machine