Windows 2.4 下 Git 下 TortoiseGit 的正确 git.exe 路径

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30709211/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:07:17  来源:igfitidea点击:

Correct git.exe path for TortoiseGit under Git for windows 2.4

windowsgittortoisegit

提问by Klas Mellbourn

I have installed the Git for windows 2.4.1 release candidate (64bit)

我已经安装了适用于 Windows 2.4.1 候选版本的Git(64 位)

It seems that after installation the following has been added to the system path

好像安装后在系统路径中添加了以下内容

C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin

But with that setting it seems that TortoiseGit stops working. When I try to do a git operation in TortoiseGit, it cannot find my git username anymore.

但是在这种设置下,TortoiseGit 似乎停止工作了。当我尝试在 TortoiseGit 中执行 git 操作时,它再也找不到我的 git 用户名了。

enter image description here

在此处输入图片说明

I have version 1.8.14.0 of TortoiseGit, which is the latest.

我有 TortoiseGit 1.8.14.0 版,这是最新的.

The TortoiseGit Git.exe Pathsetting currently points to C:\Program Files\Git\cmd.

TortoiseGitGit.exe Path设置当前指向C:\Program Files\Git\cmd.

In the TortoiseGit documentation it states

在 TortoiseGit 文档中,它指出

There is a known issue in msysGit/Git for Windows: Git for Windows provides two git.exe-files (one in a folder named bin and one in a folder named cmd). Make sure Git.exe Path points to the bin-folder within the Git for Windows installation folder.

msysGit/Git for Windows 中存在一个已知问题:Git for Windows 提供了两个 git.exe 文件(一个位于名为 bin 的文件夹中,另一个位于名为 cmd 的文件夹中)。确保 Git.exe 路径指向 Git for Windows 安装文件夹中的 bin 文件夹。

In Git 2.4 there is a folder C:\Program Files\Git\usr\bin, but that no longer contains the git.exe binary.

在 Git 2.4 中有一个文件夹C:\Program Files\Git\usr\bin,但不再包含 git.exe 二进制文件。

The git.exebinary is found in both C:\Program Files\Git\cmdand C:\Program Files\Git\mingw64\binbut neither of those settings work for TortoiseGit.

git.exe二进制中都发现了C:\Program Files\Git\cmdC:\Program Files\Git\mingw64\bin,但没有对TortoiseGit这些设置工作。

采纳答案by Jeremy Fortune

Check to make sure that your %HOME%variable in Windows is set so that TortoiseGit can find your .gitconfigfile.

检查以确保您%HOME%在 Windows 中设置了变量,以便 TortoiseGit 可以找到您的.gitconfig文件。

回答by user6664090

All of these answers are wrong. The Git.exe Path in setting is set incorrect.

所有这些答案都是错误的。设置中的 Git.exe 路径设置不正确。

Steps to fix:

修复步骤:

  1. Right click on git respostory
  2. Select TottoiseGit | Settings
  3. You will get the warning dialog
  4. Dismiss it
  5. You will get another dialog, select ignore
  6. Settings will launch
  7. Select: General (at the top of the tree)
  8. In the edit field for Git.exe path (half way down) enter the Git.exe path (in my case C:\ProgramFiles\Git\bin)
  1. 右键单击 git respository
  2. 选择 TotoiseGit | 设置
  3. 您将收到警告对话框
  4. 关闭它
  5. 你会得到另一个对话框,选择忽略
  6. 设置将启动
  7. 选择:General(在树的顶部)
  8. 在 Git.exe 路径(向下一半)的编辑字段中输入 Git.exe 路径(在我的情况下为 C:\ProgramFiles\Git\bin)

That's it!

就是这样!

回答by MrTux

TortoiseGit 1.8.14.1 (preview release) has full support for Git for Windows 2.x (no need for workarounds with adding unneeded folders to %PATH%). Before this version, TortoiseGit cannot find the git system config of Git for Windows 2.x.

TortoiseGit 1.8.14.1(预览版)完全支持 Git for Windows 2.x(无需通过向 中添加不需要的文件夹的变通方法%PATH%)。在此版本之前,TortoiseGit 找不到 Git for Windows 2.x 的 git 系统配置。

The warning you are getting means that you haven't set up the user.nameand user.emailgit config settings. This can be done for a project or also globally (in %HOME%\.gitconfig: TortoiseGit here uses the %HOME%environment variable - if it is not set TortoiseGit uses your Windows home directory automatically).

您收到的警告意味着您尚未设置user.nameuser.emailgit config 设置。这可以为项目或全局完成(在%HOME%\.gitconfig: TortoiseGit 中使用%HOME%环境变量 - 如果未设置 TortoiseGit 自动使用您的 Windows 主目录)。