我已经安装了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.
我如何解决这个问题?
当前回答
搜索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的粘贴操作。
其他回答
如果你想设置为临时用途,只需执行下面的命令。
打开命令提示符< run——> CMD > . CMD 执行以下命令。 设置路径=C:\程序文件\Git\bin 输入git,就可以了。
这是有效的当前窗口/单元格,如果你将关闭命令提示符,一切都将消失。 为了永久设置,在环境变量中设置GIT。
a.按窗口+暂停键 b.单击“高级系统设置”。
c.单击“高级选项卡”下的“环境变量”。
d.编辑“路径变量”。
e.在语句末尾添加以下行。 Git; c: \ Program Files \ \ bin。
f.按“OK”!! g.打开新的命令提示符。 h.输入“git”,按“Enter”
谢谢
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
Windows 7 32位
我正在为我的Ruby on Rails应用程序使用git。第一次,所以…
我创建了一个.bat文件,用于加载使用本教程手动输入的路径的RoR应用程序,地址是“http://www.youtube.com/watch?v=-eFwV8lRu1w”。如果你是Ruby on Rails的新手,你可能想要检查一下,因为我遵循了所有步骤,经过几次试验和错误后,它完美地工作了。
(.bat文件是可以使用notepad++编辑的,因此不需要长时间的过程,当你需要编辑路径时,你可以在创建一个.bat文件后,按照“文件称为row.bat”上方链接上的教程遵循这些简单的过程。)
right click on the .bat file, edit with notepad++. find path. insert path below the last path you inputted. ) During the tutorials I don't remember anything said in regards to using the git command so when starting a new project I had this same problem after installing git. The main issue I had was locating the folder with the bin/git.exe (git.exe did not show up in search using start menu's "search programs and files" ) NOTE I now understood that the location might vary drastically --- see below.
要定位bin/git.exe,我遵循以下步骤
1左键单击开始菜单,找到->>所有程序->> GitHub inc.。 2 .右键单击git shell,选择打开文件位置 3 .点击穿过文件夹的文件位置,找到文件夹“bin”
(我有4个文件夹命名为 1. IgnoreTemplates_fdbf2020839cde135ff9dbed7d503f8e03fa3ab4 2. lfs-x86_0.5.1 3.PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad ("bin/exe,在这里找到<<-") 4. PoshGit_869d4c5159797755bc04749db47b166136e59132 )
复制完整的链接点击探索者的url (我的是“C:\Users\username\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin”)在notepad++中打开。bat文件,并使用上面教程中关于如何添加路径到你的。bat文件的说明进行粘贴。问题解决了!
;C:\Program Files (x86)\Git\bin;C:\Program Files (x86)\Git\cmd
在环境变量中添加上述路径
注意:路径可能不同,但你应该同时添加bin和CMD
这是因为在安装时,您已经选择了默认单选按钮,只使用“Git”和“Git bash”。如果你选择“Git和命令行工具”,这就不是问题了。
解决方案#1:因为你已经安装了Git工具,现在导航到所需的文件夹,然后右键单击并使用“Git bash here”运行相同的命令,它将正常运行。 解决方案#2:尝试重新安装Git-scm并选择正确的选项。