windows - SourceTree 1.6.14 在 Windows 上找不到 Git 2.4.0 安装

标签 windows git atlassian-sourcetree

在我的 Windows 7 系统上安装 Git 2.4.0 后,我尝试将 SourceTree 1.6.14 中的选项更改为“使用系统 Git”,而不是嵌入式版本。

但是,点击“使用系统 Git”后,没有任何反应,设置仍然设置为“使用嵌入式 Git”。

如何让 SourceTree 使用安装的 Git 版本?

最佳答案

这可能会在 SourceTree 的 future 补丁中修复,但是,在此之前有如下解决方法。

2.0 之前的 Git 版本将 git.exe 存储在名为 bin 的子目录中,这正是 SourceTree 正在寻找的。从 Git >=2.0 开始,git.exe 移动到名为 cmd 的文件夹中。

因此,让 SourceTree 识别您的 Git 安装的最简单方法是使用 mklink 为文件夹创建一个符号链接(symbolic link),如下所示:

C:\Program Files (x86)\Git\>mklink /D bin cmd

编辑: 虽然上述修复了 Git 的正常 GUI 操作(提交/推送等),但它没有修复“终端”按钮,因为此命令尝试通过以下命令执行 sh.exe 并失败sh.exe 也已在 Git 2.4 中移动。

"C:\Windows\System32\cmd.exe"/c "C:\Program Files (x86)\Git\bin\sh.exe"--login -i

编辑 2:进一步阅读 - 这是 Git for Windows 维护者提出的问题 here .

关于windows - SourceTree 1.6.14 在 Windows 上找不到 Git 2.4.0 安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30259420/

相关文章:

c# - 当有人使用我的带有 "Open With"的程序时,我如何知道打开了什么文件?(C#)

Git-远程 : Repository not found

linux - 如何从 Linux 控制台将 SSH key 添加到 github?

windows - sourceTree (git) 中命令行的公钥问题

git - git rebasing无法正常工作?

python - Windows 7 : how to bring a window to the front no matter what other window has focus?

c++ - 导入 msado15.dll

windows - 调查内存泄漏

git - git 真的需要 .gitattributes 文件吗?

git - 'git add .' 的 SourceTree GUI 中的等效命令是什么?