设置shell的提示符:git
export PS1='[\u@\h \w]$ 'shell
export PS1='[\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]\[\033[32m\]\u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]]$ 'windows
编辑 /etc/profile.d/git-prompt.sh 中的 PS1 变量便可bash
1. Git-2.6.3-64-bit编码
安装成功以后spa
2. 安装 mingw-get.net
下载位置在:http://sourceforge.net/projects/mingw/files/code
在使用 MinGW Installer 这个安装器是注意要选择默认的路径,选择到
htm
C:\Program Files\Git\mingw64, 这个是git 中集成的默认的minGW,
utf-8
此后全部经过 mingw-get 安装的程序 在 git bash 中就均可以使用了
3. git bash 中文乱码
在 windows 中的 git bash 中能够运行 windows cmd中的可使用的命令,可是
默认的cmd的活动代码页(active codepage)是 936 表明的GBK编码,因此在 git bash 中执行cmd 中的命令,例如 route.exe
因为git bash 默认的编码是 utf8 ,因此此时就会出现乱码问题,
其实缘由就是:route 命令相对于 git bash 这个环境来讲,至关因而一个外部命令,而这个外部命令执行以后,最终的输出结果
就是安装 cmd 当前的 活动代码页的设置来 编码输出的信息, 而此时的 cmd的代码页是:
而此时 git bash 的设置是:
因此此时 route.exe 命令执行的输入信息,按照 gbk编码,而在git bash 中则将这些信息以 utf-8 的编码规则进行解码,
因此就出现了乱码。
解决办法: 将上面的两个编码保持一致
备注:关于代码页:Code Page Identifiers
常见代码页:
简体中文的代码页是:936,
UTF-8的代码页是:65001