修改C:\PROG\Git\etc\profile.d\git-prompt.sh

可以做个备份,但是备份文件的名字我开始用的git-prompt_bak.sh这样好像还是会都这个备份文件所以后来改为_bakgit-prompt.sh

  1. if test -f /etc/profile.d/git-sdk.sh
  2. then
  3.     TITLEPREFIX=SDK-${MSYSTEM#MINGW}
  4. else
  5.     TITLEPREFIX=$MSYSTEM
  6. fi

  7. if test -f ~/.config/git/git-prompt.sh
  8. then
  9.     . ~/.config/git/git-prompt.sh
  10. else
  11.     PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]' # set window title
  12.     PS1="$PS1"'\n' # new line
  13.     PS1="$PS1"'\[\033[32m\]' # change to green
  14.     #PS1="$PS1"'\u@\h ' # user@host<space> //
  15.     PS1="$PS1"'\[\033[35m\]' # change to purple
  16.     #PS1="$PS1"'$MSYSTEM ' # show MSYSTEM //
  17.     PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
  18.     #PS1="$PS1"'\w' # current working directory //
  19.     if test -z "$WINELOADERNOEXEC"
  20.     then
  21.         GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)"
  22.         COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}"
  23.         COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}"
  24.         COMPLETION_PATH="$COMPLETION_PATH/share/git/completion"
  25.         if test -f "$COMPLETION_PATH/git-prompt.sh"
  26.         then
  27.             . "$COMPLETION_PATH/git-completion.bash"
  28.             . "$COMPLETION_PATH/git-prompt.sh"
  29.             PS1="$PS1"'\[\033[36m\]' # change color to cyan
  30.             PS1="$PS1"'`__git_ps1`' # bash function
  31.         fi
  32.     fi
  33.     PS1="$PS1"'\[\033[0m\]' # change color
  34.     #PS1="$PS1"'\n' # new line //
  35.     PS1="$PS1"'$ ' # prompt: always $
  36. fi

  37. MSYS2_PS1="$PS1" # for detection by MSYS2 SDK

10-23 21:57
查看更多