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

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

问题描述

我想使用 worktree 功能nofollow> git 2.5 。但是,我不知道如何更新到最新版本的GitHub Desktop( not git本身)。



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

p>更新2015年11月25日。

GitHub桌面(最终)使用更新的git版本:2.5。请参阅 Brendan Foster tweet






原始答案(2015年11月初)


首先,最新的git为 Windows版本在GitHub上可用
我总是使用归档可移植表单(解压缩到任何我想要的地方,并添加到 PATH )。



但是,如果您选择了 exe setup,这意味着它已被安装在 C:\ Program Files \Git 中。然而,正如我在这里提到的,git也包含在内

在GitHub桌面自己的安装路径(%USERPROFILE%\AppData\Local\GitHub\PORTAB~1\bin



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

  cd%USERPROFILE%\AppData\Local\GitHub 
dir#记下PORTABLEGIT文件夹的确切名称:< PORTAB ...>
移动< PORTAB ...> old_PORTABLEGIT
mklink / J< PORTAB ...> C:\ Program Files \Git

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

  C:\ Users \ vonc \AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin 

然而,这不起作用:当再次启动GitHub桌面时,它会检测到更改并恢复它自己的嵌入式Git版本(1.9.5)

所以你不能轻易强迫GitHub桌面使用另一个git版本。






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

  C:\Users\vonc\AppData\Local\GitHub\PortableGit_c2b ... \etc\gitconfig 

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

  [http] 
sslcainfo = /bin/curl-ca-bundle-ghfw.crt
[凭证]
助手=!github - 凭证

[过滤器ghcleansmudge]
clean = cat
smudge = cat

这些设置是 not 存在于Git的非GitHub嵌入版本中,并且需要恢复。


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).

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?

解决方案

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


Original answer (early Nov 2015)

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).

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

However, as I mentioned here, git is also included in GitHub Desktop own installation path (%USERPROFILE%\AppData\Local\GitHub\PORTAB~1\bin)

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

cd %USERPROFILE%\AppData\Local\GitHub
dir # take note of the exact name of PORTABLEGIT folder: <PORTAB...>
move <PORTAB...> old_PORTABLEGIT
mklink /J <PORTAB...> "C:\Program Files\Git"

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

C:\Users\vonc\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin

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)

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


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:\Users\vonc\AppData\Local\GitHub\PortableGit_c2b...\etc\gitconfig

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

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天全站免登陆