我已经安装了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.
我如何解决这个问题?
当前回答
Go to My Computer => Local Disk(C:) => Program Files(x86) => Git => cmd Right Click the git => Select Properties Under the location Copy the text eg - C:\Program Files (x86)\Git\cmd Come back to the Desktop Right-click My Computer Select property Open Advanced Click Environment Variables In the System variables Find the Variable call Path Click the variable Click the Edit Button Select the Variable value Text Box . Go to the edge of the text and put semicolon(;) Then Right-click and press Paste Press Ok
其他回答
安装git之前打开cmd提示符了吗?如果是,请关闭并重新打开。
安装完成后,打开GitHub应用程序,在右上角你会注意到一个设置图标。从下拉菜单中选择“选项”,并选择“默认Shell”作为Cmd。
现在尝试在搜索中输入'git shell' (windows键和类型)并选择git shell。它应该在CMD中打开,git现在应该被识别。
如果你想设置为临时用途,只需执行下面的命令。
打开命令提示符< 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->Git Bash
带你直接到Git Shell。
搜索GitHubDesktop\app-2.5.0\resources\app\git\cmd 打开文件 复制文件位置。 寻找环境。 打开编辑系统环境变量。 打开环境变量。 在用户变量上双击Path。 点击新建 过去的 好吧 系统变量的开放路径。 新建,经过add \(反斜杠),然后OK 搜索GitHubDesktop\app-2.5.0\resources\app\git\usr\bin\ 14再次复制“Address”,重复步骤4至12的粘贴操作。