Why is “MINGW64” appearing on my Git bash?

后端 未结 7 839
抹茶落季
抹茶落季 2020-12-07 14:25

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

7条回答
  •  日久生厌
    2020-12-07 15:03

    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
    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
    # PS1="$PS1"'\[\033[35m\]'       # change to purple
    # PS1="$PS1"'$MSYSTEM '          # show MSYSTEM
    

提交回复
热议问题