Why is "MINGW64" appearing on my Git bash?
Solution 1
This is the new icon being used with Git for Windows 2.x. The website needs an update for that I guess but there are not many volunteers typically.
The MINGW64 is the value from the MSYSTEM
environment variable. This has been included in the bash prompt by setting PS1
in the /etc/bash.bashrc
file. You can either override this in your own $HOME/.profile
or edit the distributed one to remove that if you prefer.
Solution 2
Easiest way to remove 'MINGW64' is to comment two lines in file:
\Git\etc\profile.d\git-prompt.sh
...
# PS1="$PS1"'\[\033[35m\]' # change to purple
# PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
Solution 3
"Git for windows" includes git plus a variety of additional software, which you may already have on your machine. This includes:
- bash (which already comes with Windows 10)
- ssh (which is also now included in Windows 10)
- 'git bash' which includes a preferences for a PS1, a shortcut file, and some other tools.
As PS1 tastes are generally personal you may prefer your existing setup.
If you want git, but don't want all the extra software, you can get a minimal build from nuget.
However if you use a GUI that may also include an embedded git - personally I use the one included with Sourcetree. In my powershell profile:
Add-PathVariable "${env:UserProfile}\AppData\Local\Atlassian\SourceTree\git_local\bin"
This provides git without any additional changes to your system or extra copies of other software.
(Add-Pathvariable
comes from PSCX by the way)
Solution 4
As stated by @patthoyts
MINGW64 is the new icon being used with Git for Windows 2.x. The MINGW64 is the value from the MSYSTEM environment variable. This has been included in the bash prompt by setting PS1 in the /etc/bash.bashrc file. You can either override this in your own $HOME/.profile or edit the distributed one to remove that if you prefer.
MINGW64 and the name of the system is something that we don't want to or need to see always and sometimes may want to remove them for effective use of display space. To do that, we just need to comment out 4 lines in \Git\etc\profile.d\git-prompt.sh
which is typically inside your program files.
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
These are the 4 lines in git-prompt.sh
, typically line number 14 to 17, that can be commented out by placing #
at the start of each line to remove computer name shown in green and MSYSTEM shown in purple. If you just want to remove one of these, you can comment lines accordingly. It should look similar to this
# 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
Solution 5
It's a little different in the new git versions.
copy the line below in
/etc/bash.bashrc
:export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n'"${_ps1_symbol}"' '
-
add it to
~/.bashrc
and do some custom edit:export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n '
If you do not like the additional blank line when press
Enter
, just remove the\n
above. source the
~/.bashrc
file:source ~/.bashrc
-
my terminal example:
Related videos on Youtube
FelipeKunzler
Updated on February 25, 2022Comments
-
FelipeKunzler about 2 years
I had to format my laptop, and so I had to install Git again. However it is quite different from the one I had yesterday, the icon is not the default orange one anymore, it looks more like Chrome now.
The
bash
is quite different, including a purple "MINGW64
" in every line. Why is it there?Is this the new final version? Or did I download something different?
I downloaded https://github.com/git-for-windows/git/releases/download/v2.5.1.windows.1/Git-2.5.1-64-bit.exe from https://git-scm.com/downloads .
Thanks!
-
Etan Reisner over 8 yearsThere was just a release on Aug 31st. So you likely had an older version before that. This version clearly has a newer icon and newer shell configuration than the one you had before. We don't know what you downloaded though (since you didn't tell us) so can't say much about whether it was the right one.
-
FelipeKunzler over 8 yearsHi, I put the link on the question, the strange thing about the icon is that I couldn't find it anywhere else. Any clue about the "MINGW64" in every line or why is that there? Thanks!
-
Etan Reisner over 8 yearsThat's the new build.
MINGW64
is likely the platform. What doesdeclare -p PS1
say? It should have something for that bit in there (possibly a function call). If you don't like it you can change it. -
Etan Reisner over 8 yearsYeah, I don't know why that new icon isn't on the site under Logos or whatever. Maybe it snuck into the Windows build by accident or maybe the site is just lagging or maybe something else entirely. You could contact the git people if you directly if you want a more official answer.
-
FelipeKunzler over 8 yearsWhen I type this line "declare -p PS1" I get the following: declare -x PS1="\[\\033]0;\$MSYSTEM:\${PWD//[^[:ascii:]]/?}\\007\93;\\n\[\\033[ 32m\]\\u@\\h \[\\033[35m\]\$MSYSTEM \[\\033[33m\]\\w\[\\033[36m\]`__git_ ps1`\[\\033[0m\]\\n\$ "
-
aliopi over 6 yearsEverytime I install Git I have to search for this question
-
-
Damon over 8 yearsnavigating in the bash terminal, this will be at
/etc/profile.d/git-prompt.sh
-
Sonic Soul about 8 yearson windows this can be in C:\Program Files\Git\etc\profile.d
-
Sonic Soul about 8 yearsthere is also TITLEPREFIX where you can remove it from the window title "TITLEPREFIX=SDK #-${MSYSTEM#MINGW}"
-
Dylan Hildenbrand over 7 years
$HOME/.profile
didn't exist for me, so I created it, copied the contents of/etc/git-prompt.sh
, and modified it around the line#show MSYSTEM
-
KyleMit over 7 yearsIf you're terminal is from an Atlassian Install of Source Tree, then this file is in
%LOCALAPPDATA% \Atlassian\SourceTree\git_local\etc\profile.d
-
ctrueden about 7 yearsDownvoted due to the editorializing. Good info, though.
-
ctrueden almost 7 years1) The phrase "whole bunch of unnecessary stuff" conveys your personal opinion about it. It would be more neutral and more technically accurate to describe what is included and why. Be respectful of the fact that people have put a lot of time into Git for Windows, it is a large community, and things are structured the way they are for good reasons. 2) Saying Git Bash "isn't actually a thing" is dismissive. It is a thing: it's the prompt that ships with Git for Windows, built on MinGW. Saying it's "just someone's preferred PS1" implies a personal mandate rather than community-driven OSS.
-
ctrueden almost 7 yearsI still think the language is a bit unfair—e.g., bash does not come with versions of Windows before recent Windows 10 updates; in general it would be fairer to state something like "includes git plus a variety of additional software intended to make Git work out of the box regardless of your existing Windows configuration." But I do really appreciate the effort, so I switched to an upvote.
-
mikemaccana almost 7 years@ctrueden Thanks, adjusted to specify Windows 10.
-
Quang Van over 6 yearsnice! I had to copy the contents in my \etc\profile.d\git-prompt.sh into ~\.bash_profile and then commented out those two lines. Works!
-
aliopi over 6 yearsThe answer how to get rid of the pink MINGW64 is here stackoverflow.com/a/32912485/332788
-
f4d0 over 6 yearsDoes this have anything to do with having MINGW64 installed?
-
Maciej Bledkowski about 5 yearsIt would be on probably line 16 and 17 ;)
-
sfscs about 5 yearsThanks! I needed admin privileges to be able to modify the file. Just open you text editor as admin and then manually open the file.
-
Jan Kyu Peblik about 5 yearsThis works to override PS1 utterly, but eliminates the git (branch) information from the prompt, which might make one wonder why a person is even using Git Bash as opposed to something less specific, like Cygwin with git installed and git-completion.bash in place (which in fairness one might wonder anyway).
-
Jan Kyu Peblik about 5 yearsDoesn't really answer question.
-
ggorlen about 5 yearsThanks for your answer. Can you explain how this works to solve the problem?
-
Jan Kyu Peblik about 5 years@ggorlen It overrides (progressively enhances) PS1 by substituting out the variables (and singular characters following them) with nothing at all. Nothing is required but running that command (and re-sourc'ing ~/.bashrc or re-running Git Bash).
-
ggorlen about 5 yearsNice, thanks. I recommend that you edit your post to include that information for future readers.
-
Jan Kyu Peblik about 5 years@ggorlen Pass. There are already enough essays here posing as answers. Plus it's right there in a comment that bored bureaucrats can merely not delete pointlessly. (I like your website.)
-
user2023370 over 4 yearsI rather see this as the only one attempting to answer the real question. Who really cares about the pink glyphs of "MINGW".
-
Evan M about 3 yearsgreat answer, easy to follow- many thanks