Install developer tools on Windows Subsystem for Linux

From JMK Wiki
Revision as of 15:58, 3 June 2018 by Gabor Hudiczius (talk | contribs) (initial version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Install git and maven

Install git and maven:

root@localhost ~ # apt install git maven

Verify git and mvn version:

user@localhost ~ $ git --version
user@localhost ~ $ mvn -v

Include the git branch name in the PS1 prompt

Note: based on

Create and edit the /usr/local/bin/ file:

root@localhost ~ # nano -w /usr/local/bin/

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

Edit the ~/.bashrc file of the user and add the following lines:

source /usr/local/bin/
export PS1="\[\033[01;32m\]\u@\h\[\033[01;34m\] \w\[\033[01;33m\]\$(parse_git_branch) \[\033[01;34m\]\$\[\033[00m\] "

Reload the ~/.bashrc file

user@localhost ~ $ source ~/.bashrc

For more git prompt manipulation see and