无法在CMD上使用GIT命令 [英] unable to use GIT commands on CMD
问题描述
我已经为Windows版本1.2.2安装了GIT. 当我现在在命令行中尝试git命令时,我看到:
I've installed GIT for windows version 1.2.2 When I try the git command in the command line right now I see:
'git'不被识别为内部或外部命令,可操作程序或批处理文件.
'git' is not recognized as an internal or external command, operable program or batch file.
此外,Windows的黑白msysGIT和Git有什么区别吗? 在cmd上使用GIT命令行需要msysGIT吗?
More over is there a difference b/w msysGIT and Git for windows? is msysGIT required to use GIT command line on cmd?
我想通过CMD使用GIT.请指教!
i want to use GIT via CMD. please advice!
推荐答案
您需要将git添加到用户或系统 PATH
.
You need to add git to user or system PATH
.
- 右键单击"我的电脑" .
- 点击高级系统设置.
- 单击环境变量.
- Right-click on My Computer.
- Click on Advanced System Settings.
- Click on Environment Variables.
然后在系统变量下查找Path
变量,然后单击编辑.
像这样在字符串的末尾添加git的bin
和cmd
的路径,分别在文件夹路径列表的底部添加两个文件夹路径:
Then under System Variables look for the Path
variable and click on Edit.
Add the path to git’s bin
and cmd
at the end of the string like this respectively add the two folder paths at bottom of the list of folder paths:
;C:\Program Files\Git\bin;C:\Program Files\Git\cmd
或者在用户变量下查找Path
变量,然后单击 Edit 并添加上面写的两个文件夹路径.如果没有用户 Path
,请单击新建,并添加名称为Path
和值
Alternatively look under User Variables for the Path
variable and click on Edit and add the two folder paths as written above. Click on New if there is no user Path
and add this environment variable with name Path
and value:
C:\Program Files\Git\bin;C:\Program Files\Git\cmd
这篇关于无法在CMD上使用GIT命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!