Personal blog and hacks by Raymundo Cassani

poshbash in Windows bash

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.

Git-Posh example

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.

Note: Enable Copy/Paste in Bash
  1. Right click in the Window Title bar > Properties
  2. Enable Quick Edit Mode
  3. Copy is Ctrl-C and Paste is Right-click

Adding posh-git-bash prompt to Bash on Windows

  1. Run Bash and go to HOME directory in bash

    $ cd ~
  2. Download the file from this repository, and rename it as

    ~$ wget -O
  3. Now you need to edit your the file ~/.bashrc Add the following 2 lines at the beginning of ~/.bashrc file, you can use the text editors nano or vim for this.

    source ~/
    PROMPT_COMMAND='__posh_git_ps1 "\u@\h:\w" "\\\$ ";'$PROMPT_COMMAND
  4. Restart Bash


comments powered by Disqus