我已经安装了Git for Windows,但是当我尝试在命令提示符中使用Git命令时,我得到以下错误:
'git' is not recognized as an internal or external command,
operable program or batch file.
我如何解决这个问题?
我已经安装了Git for Windows,但是当我尝试在命令提示符中使用Git命令时,我得到以下错误:
'git' is not recognized as an internal or external command,
operable program or batch file.
我如何解决这个问题?
当前回答
;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
在环境变量中添加上述路径
注意:路径可能不同,但你应该同时添加bin和CMD
其他回答
如果你使用的是Windows 10,请这样做:
Go to Start Start typing 'This PC' Right-click This PC, choose Properties On the left side of the window that pops up, click on Advanced System Settings Click on the Advanced tab Click on the Environmental Variables button at the bottom Down in the System Variables section, double-click Path Click the New button in the top right corner Add this path: C:\Program Files\Git\bin\ then click the enter key Add another path: C:\Program Files\Git\cmd Close & re-open the console if it's already open.
我带你经历了漫长的过程,让你接触到不同的Windows/菜单。祝你好运。
如果你想设置为临时用途,只需执行下面的命令。
打开命令提示符< run——> CMD > . CMD 执行以下命令。 设置路径=C:\程序文件\Git\bin 输入git,就可以了。
这是有效的当前窗口/单元格,如果你将关闭命令提示符,一切都将消失。 为了永久设置,在环境变量中设置GIT。
a.按窗口+暂停键 b.单击“高级系统设置”。
c.单击“高级选项卡”下的“环境变量”。
d.编辑“路径变量”。
e.在语句末尾添加以下行。 Git; c: \ Program Files \ \ bin。
f.按“OK”!! g.打开新的命令提示符。 h.输入“git”,按“Enter”
谢谢
我遇到过这个问题,在安装Git后解决了 Downloadlink: https://git-scm.com/downloads
安装完成后,打开GitHub应用程序,在右上角你会注意到一个设置图标。从下拉菜单中选择“选项”,并选择“默认Shell”作为Cmd。
现在尝试在搜索中输入'git shell' (windows键和类型)并选择git shell。它应该在CMD中打开,git现在应该被识别。
开始->所有程序->Git->Git Bash
带你直接到Git Shell。