新 Windows 7 git 安装,垃圾箱中缺少命令,例如git bash 的别名

New Windows 7 git install, missing commands in bins, e.g. alias for git bash

刚刚在我的 Windows 7 笔记本电脑和台式机上安装了 git,安装程序中似乎缺少一些标准的 Unix 命令。我是 Git 的新手,对 Windows 的东西不是很好。

我通过添加一个简单的别名尝试使用 .bashrc 配置 git bash 发现了这个问题:

alias ls 'ls -F'

.bashrc 为 运行 时(并且在 shell 启动时执行),我收到此消息:

$ alias ls 'ls -F'

bash: alias: ls: not found

bash: alias: ls -F: not found

仔细检查 bin 目录(/bin/usr/bin,即分别为 C:\Program Files\Git\binC:\Program Files\Git\usr\bin),没有 aliasalias.exe.

我假设这与重新创建到 windows 可执行文件中的 Unix 命令有关,而不是我遗漏的某个路径分支。我检查了路径,但找不到一些隐藏的 bin 目录。

我看过几篇关于自己安装 Cygwin 的帖子,我可以做到这一点,但在开始对我的笔记本电脑和台式机进行长期修复之前,我想知道我是否遗漏了什么或我的 git 初始安装有问题,或者如果有我应该添加的软件包——将不胜感激任何帮助。

正确的语法是:

alias ls='ls -F'

别名是 bash builtin command,因此您不会在 git 分布中的任何地方找到 alias.exe。