我几天前安装了Git For Windows 2.7.2。现在,使用Git For Windows
提供的可选工具cmd.exe
时遇到了一些问题。在以前版本的Git For Windows
(或说msysgit
)中,我可以通过修改Git/etc/git-completion.bash
来配置这些工具。例如:
alias ls='ls --show-control-chars --color=auto'
我用这种方式使ls
显示正常包含中文字符的文件名。现在看来这种方式不起作用。实际上git-completion.bash
下没有Git/etc/
。文件夹git-completion.bash
下的 一个Git/mingw64/share/git/completion
。我试图将其复制到Git/etc
并添加上面的别名,但这些都不起作用。这些工具仅适用于Git Bash
。那么我应该如何与git
一起配置这些工具,以便在cmd.exe
?
答案 0 :(得分:1)
This answer解释了为什么您不再拥有此功能。简而言之,msysgit提供了一个unix shell模拟器,mingw。 Git for Windows是在Windows环境中编译的git。
因此,ls
只是Windows shell中dir
的别名,而非mingw' ls
。如果要创建一些Windows别名,可以使用doskey
。 Here's an answer为此。
或者,我建议您开始使用PowerShell,您可以使用these等强大的命令设置$profile
变量。