The posh-git-bash prompt, for Git, is a useful tool that shows information about the current status of a local Git repository respect to local and remote (e.g. GitHub) repositories; in this way, it's easy to see if the repository is ahead or behind, has uncommitted changes, is up-to-date, etc.
The posh-git-bash prompt is included in the PowerShell installed with GitHub Desktop software for Windows. This post describes how add the posh-git-bash prompt functionality into the Bash on Windows10.
If Bash on Windows is not already installed, this is the installation guide.
- Right click in the Window Title bar > Properties
- Enable Quick Edit Mode
- Copy is Ctrl-C and Paste is Right-click
Run Bash and go to HOME directory in bash
$ cd ~
Download the file
git-prompt.shfrom this repository, and rename it as
~$ wget https://raw.githubusercontent.com/lyze/posh-git-sh/master/git-prompt.sh -O .git-prompt.sh
source ~/.git-prompt.sh PROMPT_COMMAND='__posh_git_ps1 "\u@\h:\w" "\\\$ ";'$PROMPT_COMMAND