如何在 Windows 上从 GitHub Desktop 更新 git 版本 [英] How to update git version from GitHub Desktop on Windows

查看:82
本文介绍了如何在 Windows 上从 GitHub Desktop 更新 git 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 中引入的新 worktree 功能git 2.5.但是,我不知道如何更新到最新版本的 GitHub Desktop(不是 git 本身).

I want to use the new worktree functionality introduced in git 2.5. However, I don't know how to update to the most recent version of GitHub Desktop (not git itself).

我安装了桌面版 GitHub 并希望它附带最新版本,但是 git --version 返回 git version 1.9.5.github.0.但如果我理解正确的话,我们已经是 2.6.x 版了!那么如何在我的 Windows 机器上更新到这个版本,我安装的唯一版本的 git 是使用 GH 桌面的?

I install GitHub for desktop and hoped it ships with the most recent version, however git --version returns git version 1.9.5.github.0. But if I understand correctly, we're already at version 2.6.x! So how can I update to this version on my Windows machine, where the only version of git I installed was with the GH Desktop?

推荐答案

2015 年 11 月 25 日更新.
值得一提的是,GitHub Desktop(终于)使用了更新的 git 版本:2.5.请参阅 Brendan Foster 推文.

Update Nov. 25th, 2015.
For what it is worth, GitHub Desktop (finally) uses a more recent git version: 2.5. See Brendan Foster tweet.

原始答案(2015 年 11 月上旬)

Original answer (early Nov 2015)

首先,在 GitHub 上提供 windows 版本的最新 git.
我总是使用存档便携形式(在我想要的任何地方解压缩,并添加到 PATH).

First, the latest git for windows release is available here on GitHub.
I always use the archive portable form (unzipped anywhere I want, and added to the PATH).

但是如果您选择了 exe 设置,则表示它已安装在 C:Program FilesGit 中.

But if you have chosen the exe setup, that means it has been installed in C:Program FilesGit.

但是,正如我这里提到的,git 也包含在 GitHub Desktop 自己的安装路径中(%USERPROFILE%AppDataLocalGitHubPORTAB~1in)

However, as I mentioned here, git is also included in GitHub Desktop own installation path (%USERPROFILE%AppDataLocalGitHubPORTAB~1in)

理论上,您可以用目录 JUNCTION 替换文件夹 PORTAB~1 的确切值:

You could, in theory, replace the exact value of the folder PORTAB~1 by a directory JUNCTION:

cd %USERPROFILE%AppDataLocalGitHub
dir # take note of the exact name of PORTABLEGIT folder: <PORTAB...>
move <PORTAB...> old_PORTABLEGIT
mklink /J <PORTAB...> "C:Program FilesGit"

在我最新的 GitHub Desktop 3.0.7.1 3397ae4 中,我看到:

In my latest GitHub Desktop 3.0.7.1 3397ae4, I see:

C:UsersvoncAppDataLocalGitHubPortableGit_c2ba306e536fdf878271f7fe636a147ff37326adin

但是,这行不通:再次启动 GitHub Desktop 时,它会检测到更改并恢复自己的嵌入式 Git 版本 (1.9.5)

However, that would not work: when starting GitHub Desktop again, it would detect the change and restore its own embedded Git version (1.9.5)

所以你不能轻易地强制 GitHub Desktop 使用另一个 git 版本.

So you can't force easily GitHub Desktop to use another git version.

即使您能够以某种方式强制 GitHub for Desktop 使用另一个版本的 Git,您也必须仔细报告其自己的内部 git 系统配置:

Even if you were able somehow to force GitHub for Desktop to use another version of Git, you would have to carefully report its own internal git system configuration:

 C:UsersvoncAppDataLocalGitHubPortableGit_c2b...etcgitconfig

此文件指向 GitHub Desktop 的特定设置:

This file points to GitHub Desktop specific settings:

[http]
        sslcainfo = /bin/curl-ca-bundle-ghfw.crt
[credential]
        helper = !github --credentials

[filter "ghcleansmudge"]
        clean = cat
        smudge = cat

这些设置出现在非 GitHub 嵌入式 Git 版本中,需要恢复.

THose settings are not present in a non-GitHub embedded version of Git, and would need to be restored.

这篇关于如何在 Windows 上从 GitHub Desktop 更新 git 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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