简体   繁体   English

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

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

Just installed git on my Windows 7 laptop and desktop and it seems that some standard Unix commands are missing in the setup.刚刚在我的 Windows 7 笔记本电脑和台式机上安装了 git,似乎设置中缺少一些标准的 Unix 命令。 I'm new to Git and not that great with Windows stuff.我是 Git 的新手,对 Windows 的东西不太好。

I found out the issue by trying to configure the git bash using a .bashrc by adding a simple alias thus:我通过添加一个简单的别名尝试使用.bashrc配置 git bash 发现了这个问题:

alias ls 'ls -F'

When the .bashrc is run (and it's getting executed when the shell starts), I get this message:.bashrc运行时(并在 shell 启动时执行),我收到以下消息:

$ alias ls 'ls -F'

bash: alias: ls: not found

bash: alias: ls -F: not found

Upon closer examination of the bin directories ( /bin , /usr/bin , ie C:\\Program Files\\Git\\bin and C:\\Program Files\\Git\\usr\\bin , respectively) there is no alias or alias.exe .在仔细检查 bin 目录( /bin/usr/bin ,即C:\\Program Files\\Git\\binC:\\Program Files\\Git\\usr\\bin )后,没有aliasalias.exe

I'm assuming this has something to do with Unix commands re-created into windows executable and not some branch of a path that I'm missing.我假设这与重新创建到 Windows 可执行文件中的 Unix 命令有关,而不是我缺少的某个路径分支。 I've checked on the path and cannot find some hidden bin directory.我检查了路径,但找不到一些隐藏的 bin 目录。

I've seen several postings on installing Cygwin on it's own and I can do this but before launching into a protracted fix for both my laptop and desktop I'd like to know if I'm missing something or my git initial install is bad or if there's a package that I should be adding -- would appreciate any assistance.我已经看到了几个关于单独安装 Cygwin 的帖子,我可以做到这一点,但在为我的笔记本电脑和台式机启动长期修复之前,我想知道我是否遗漏了什么或者我的 git 初始安装是坏的还是如果有我应该添加的包 - 将不胜感激任何帮助。

The correct syntax would be:正确的语法是:

alias ls='ls -F'

alias is a bash builtin command , so you won't find an alias.exe anywhere in the git distribution. alias 是bash 内置命令,因此您不会在 git 发行版中的任何地方找到 alias.exe。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows中使用Git Bash有什么命令,例如在git diff模式下? - What are the commands for using Git Bash in Windows e.g. when in git diff mode? Windows git bash缺少git difftool - Missing git difftool for windows git bash 从GNU makefile调用Windows命令(例如del) - Calling Windows commands (e.g. del) from a GNU makefile Windows Git Bash Shell无法找到命令? - Windows Git Bash shell cannot find commands? 如何在 Git 中的 Windows 上检出文件名中带有特殊字符(例如?)的文件,同时在 repo 中保留原始名称? - How do I check out files with special characters in the file name (e.g. ?) on Windows in Git while keeping the original name in the repo? 如何在Windows中使用git bash和npm安装python - How to install python with git bash and npm in windows 如何在没有 Git Bash 或 GUI 的情况下在 Windows 10 上安装 git? - How to install git on Windows 10 without Git Bash or GUI? 在Git bash中设置全局工作目录别名(Windows) - Set global working directory alias in Git bash (Windows) 在 Windows Git Bash 上添加新命令 - Add new command on Windows Git Bash / bin / env:python:没有这样的文件或目录(Windows通过Git Bash尝试安装新的Parse Cloud Code) - /bin/env: python: No such file or directory (Windows through Git Bash trying to install new Parse Cloud Code)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM