Where is git.exe located?

2019-01-02 22:12发布

I have PyCharm and I am looking around trying to find git.exe to set it up with my repo.

What is the PATH to git.exe?

30条回答
Fickle 薄情
2楼-- · 2019-01-02 22:14

Here are step by step instructions for you to find out:

  1. If you're using any version of Windows, do Ctrl - Shift - Esc of open Task Manager.
  2. Open GitHub, and look into Task Manager.
  3. There should be something like this: What's in Task Manager when GitHub is open.
  4. Right click the row called GitHub, and select "Open file location".
  5. A window should pop up, showing you where the file is. Github.exe found!


There you go!

You can do this with any application, not just GitHub.

查看更多
叛逆
3楼-- · 2019-01-02 22:14

I am working on OSX, and saw this issue. I found xcode disabled git, causing me to agree to the T&Cs again. I fixed by:

  1. in a terminal window, within my project folder: git status
  2. I recieved the following log entry: Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
  3. I ran the following: sudo git status
  4. I then agreed to the T&Cs and everything was hunky dory
查看更多
看我几分像从前
4楼-- · 2019-01-02 22:15

Well I just searched for git.exe on my Windows.
Many files returned with names like git-something.exe and git-somethingElse.exe.
Out of those I could find a file with the exact name git.exe. I opened the file and could see cmd with various git commands, which made me decide that it's the correct one.
Pasted the file's path (below) to PyCharm and it worked.

C:\Users\*Username*\AppData\Local\GitHub\PortableGit_cba306e536fdf878271f7fe636a147f7326ad\cmd\git.exe

PS: I installed Git and GitHub through Windows the GitHub's Client Installation.

查看更多
三岁会撩人
5楼-- · 2019-01-02 22:18

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\<username>\AppData\Local\GitHub\PortableGit_<numbersandletters>\bin\git.exe

That's the situation for me, in Windows 7 + version 1.0 of GitHub for Windows.

In Windows 10 it appears to be in:

C:\Users\<username>\AppData\Local\GitHub\PortableGit_<numbersandletters>\cmd\git.exe

( \cmd versus \bin)

From GitHub Desktop 1.1

The UI is different and the Git path now is in:

C:\Users\<username>\AppData\Local\GitHubDesktop\app-<appversion>\resources\app\git\cmd\git.exe

PS: AppData is a hidden folder by default.

查看更多
男人必须洒脱
6楼-- · 2019-01-02 22:19

C:\Users\<username>\AppData\Local\GitHub\PortableGit_<random hash>\cmd\git.exe is where my git.exe is located on Windows 10, Git version 2.10.0.0

Edit: With GitHubDesktop, the location changed to this

C:\Users\<username>\AppData\Local\GitHubDesktop\app-1.0.1\resources\app\git\cmd

or the easier way

%USERPROFILE%\AppData\Local\GitHubDesktop\app-1.0.1\resources\app\git\cmd
查看更多
聊天终结者
7楼-- · 2019-01-02 22:19

On windows if you have git installed through cygwin (open up cygwin and type git --version to check) then the path will most likely be something like C:\cygwin64\bin\git.exe

查看更多
登录 后发表回答