Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove "MINGW" text from Git Bash prompt and window title

Remove "MINGW" text from Git Bash prompt and window title

Quickly remove the text without having to create a custom prompt.

Edit the file: C:\Program Files\Git\etc\profile.d\

 if test -f ~/.config/git/
        . ~/.config/git/
-       PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
+       PS1='\[\033]0;$PWD\007\]' # set window title
        PS1="$PS1"'\n'                 # new line
        PS1="$PS1"'\[\033[32m\]'       # change to green
        PS1="$PS1"'\u@\h '             # user@host<space>
-       PS1="$PS1"'\[\033[35m\]'       # change to purple
-       PS1="$PS1"'$MSYSTEM '          # show MSYSTEM
        PS1="$PS1"'\[\033[33m\]'       # change to brownish yellow
        PS1="$PS1"'\w'                 # current working directory
        if test -z "$WINELOADERNOEXEC"
                GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"

Note: After an update the file will be overwritten, so you will need to apply the changes again.

Tested on: Git for Windows

Reference: How To Customize The Git For Windows Bash Shell Prompt


This comment has been minimized.

Copy link

@markfee markfee commented Jan 31, 2018

alternatively (and without overwriting the raw scripts) add the following to your .bashrc



This comment has been minimized.

Copy link

@dorzhinov dorzhinov commented Jan 4, 2019

Setting MSYSTEM='' affects uname, which in turn will affect everything that depends on uname. For instance, it'll break maven colors. From mvn script:

case "`uname`" in
  CYGWIN*) cygwin=true;;
  MINGW*) mingw=true;;

So, I'd rather modify etc\profile.d\


This comment has been minimized.

Copy link

@BenMPen BenMPen commented Mar 14, 2019

It seems like creating a ~/.config/git/ file with modified code would be a reasonable option; it also allows for other customizations which is a good place to be. Just write a copy of the current to ~/.config/git and you can put in any persistent customization you would like. When you update or re-install git, your new prompt should still work, so you just have to keep your eyes on the new features for new prompt items you want to incorporate.


This comment has been minimized.

Copy link

@facosta0787 facosta0787 commented Jun 5, 2019

Excellent, thanks for your help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment