在Windows 10命令行中启用git [英] Enabling git in Windows 10 command line

查看:691
本文介绍了在Windows 10命令行中启用git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法从我的本地Windows命令行中使git工作。

我尝试了PowerShell,我的环境变量中有git bin的路径,但它仍然给我一个 命令未找到当我键入 git 时。我已经看过解决方案
此处,并且它们都不适用于me。
我没有 C:/ Program Files / git文件夹(或Program Files(x86))

I cannot seem to make git work from my native Windows command line.
I have tried PowerShell, I have the path to the git bin in my Environment Variables, but it is still giving me a "command not found" when I type git. I have looked at the solutions here, and none of them work for me.
I don't have a C:/Program Files/git folder (or Program Files(x86)).

我可以让命令行git工作,如果我打开git桌面应用程序,然后使用打开启用git的终端选项。

I can make command line git work if I open up the git desktop app and then use the "open a terminal with git enabled" option from there.

这一切都很好,除了打开桌面应用程序需要永久在我的笔记本电脑上使用,并且我希望能够通过命令行来拉取我的代码。

That is all well and good, except that opening the desktop app takes forever on my laptop, and I would prefer to be able to just whip out the command line to pull my code.

如果任何人有任何建议,我很乐意重新安装git并遵循特定的指示,或者安装更可行的git版本。
谢谢。

I am open to reinstalling git and following specific instructions, or installing a more workable version of git, if anyone has suggestions. Thank you.

推荐答案

简单地解压缩最新的 git for windows release portable archive(like PortableGit-2.7.2-64-bit.7z.exe )任何你想要的,并添加到你的路径:

Simply uncompress the latest git for windows release portable archive (like PortableGit-2.7.2-64-bit.7z.exe) anywhere you want and add to your PATH:

 c:\path\to\git;c:\path\to\git\bin;c:\path\to\git\usr\bin;c:\path\to\git\mingw64\bin

您将得到 git-bash.exe (最近4.3+ bash 基于msys2 ),而且在您的常规CMD shell中也有200多个unix命令。

You will get git-bash.exe (recent 4.3+ bash based on msys2), but also 200+ unix commands right in your regular CMD shell.

这篇关于在Windows 10命令行中启用git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆