如何制作Git For Windows 2.7的可选工具加载自定义配置?

时间:2016-02-28 12:49:33

标签: windows git cmd

我几天前安装了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

中使用它们

1 个答案:

答案 0 :(得分:1)

This answer解释了为什么您不再拥有此功能。简而言之,msysgit提供了一个unix shell模拟器,mingw。 Git for Windows是在Windows环境中编译的git。

因此,ls只是Windows shell中dir的别名,而非mingw' ls。如果要创建一些Windows别名,可以使用doskeyHere's an answer为此。

或者,我建议您开始使用PowerShell,您可以使用these等强大的命令设置$profile变量。