本文翻译自:Where is git.exe located?
I have PyCharm and I am looking around trying to find git.exe to set it up with my repo. 我有PyCharm,现在正在四处寻找git.exe,以使用我的存储库进行设置。
What is the PATH to git.exe? git.exe的路径是什么?
#1楼
参考:https://stackoom.com/question/o3A9/git-exe在哪里
#2楼
If you can use the git command it should be in your path? 如果可以使用git命令,它应该在您的路径中吗? thus this should work asuming linux or linux like os 因此,这应该工作假设linux或os之类的linux
which git
else also asuming linux like os 否则也像os一样假设linux
cd /
find . -name "*git*"
if on windows tell me what version you are using and I'll help you. 如果在Windows上告诉我您使用的是什么版本,我会帮助您。 The default path on windows is
C:\\Program Files (x86)\\Git
. Windows上的默认路径是C:\\Program Files (x86)\\Git
。The name of the executable is not
git.exe
on all systems. 在所有系统上,可执行文件的名称都不是git.exe
。#3楼
If
git.exe
is indeed in your %PATH%
(that is, if you can type a git --version
in a DOS windows), then which git.exe
will tell you where. 如果git.exe
确实位于您的%PATH%
(也就是说,如果您可以在DOS窗口中键入git --version
),则which git.exe
会告诉您在哪里。 (provided you did install GoW: Gnu on Windows : 130 unix commands compiled for windows, including
which
). (前提是您确实在Windows上安装了GoW:Gnu :130个针对Windows编译的unix命令,包括which
)。Jonny Leeds comments below that you also can use
where git.exe
乔尼·利兹(Jonny Leeds) 在下面评论说,您也可以where git.exe
使用 (except with Powershell, for you need to use
where.exe git.exe
, instead of the PowerShell command where
) (Powershell除外,因为您需要使用where.exe git.exe
,而不是PowerShell命令where
)If not, don't forget you can install git wherever you want, with the 如果没有,请不要忘记可以在任何位置安装git
Update 2015: use the portable version of "git-for-windows" , like: 2015年更新: 使用便携式版本的“ git-for-windows” ,例如:
PortableGit-2.4.4.2-3rd-release-candidate-64-bit.7z.exe
Then add to %PATH%: 然后添加到%PATH%:
-
c:\\path\\to\\PortableGit-2.4.4.2-3rd-release-candidate-64-bit\\cmd
-
c:\\path\\to\\PortableGit-2.4.4.2-3rd-release-candidate-64-bit\\usr\\bin
git.exe
, but also 200+ executable for Unix commands! 您不仅会获得git.exe
,而且还将获得200多个Unix命令的可执行文件! No more GnuOnWindows to install. 不再需要安装GnuOnWindows。 See more at " Why is it that if you download Git 2.0 from the net, you always get a 1.9.4 installer package? ". 请参阅“ 为什么从网上下载Git 2.0总是得到1.9.4安装程序包? ”。
More recently (2017), from Luke McGregor 's answer , for the new GitHub Desktop : 最近(2017年),来自Luke McGregor的答案 ,用于新的GitHub Desktop :
"%LOCALAPPDATA%\GitHubDesktop\app-[gfw-version]\resources\app\git\cmd\git.exe"
For instance:
%LOCALAPPDATA%\GitHubDesktop\app-1.0.1\resources\app\git\cmd
#4楼
如果您安装了msysgit ,则该路径在64位系统上看起来像
c:\\Program Files (x86)\\Git\\bin\\git.exe
,否则只需下载并安装它,PyCharm并不随Git客户端一起提供。#5楼
If you're using GitHub for Windows , git.exe may not be in your PATH, but you may find it in a location like:
C:\\Users\\\\AppData\\Local\\GitHub\\PortableGit_\\bin\\git.exe
如果您在Windows上使用GitHub ,则git.exe可能不在您的PATH中,但您可以在以下位置找到它: C:\\Users\\\\AppData\\Local\\GitHub\\PortableGit_\\bin\\git.exe
That's the situation for me, in Windows 7 + version 1.0 of GitHub for Windows. 我的情况就是这样,在Windows 7 + GitHub for Windows版本1.0中。
In Windows 10 it appears to be in: 在Windows 10中,它似乎位于:
C:\\Users\\\\AppData\\Local\\GitHub\\PortableGit_\\cmd\\git.exe
( \\cmd versus \\bin) (\\ cmd与\\ bin)
From GitHub Desktop 1.1 从GitHub Desktop 1.1
The UI is different and the Git path now is in: 用户界面有所不同,Git路径现在位于:
C:\\Users\\\\AppData\\Local\\GitHubDesktop\\app-\\resources\\app\\git\\cmd\\git.exe
【git.exe在哪里()】 PS: AppData is a hidden folder by default. PS: AppData默认为隐藏文件夹。
#6楼
First ,you should install github in your PC; 首先,您应该在您的PC上安装github; Second,you can download the tool ' Everything '; 其次,您可以下载“ 一切 ”工具; Third,open the tool everything ,type git.exe ,then you will find the location and copy the location to PyCharm ,and Test,you will see successfully! 第三,打开所有工具,输入git.exe ,然后找到该位置并将该位置复制到PyCharm并进行测试,您将看到成功!
推荐阅读
- Git教程目录
- Linux|将项目部署到GitHub上(详解)
- 从零开始快速搭建本地 Kubernetes 测试环节
- 所有餐饮人都应该知道的数字化正确姿势(2022 企业效能挑战赛一等奖《连锁餐饮收银管理》)