How to update git version from GitHub Desktop on Windows

后端 未结 4 1846
忘了有多久
忘了有多久 2020-12-02 00:38

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

4条回答
  •  被撕碎了的回忆
    2020-12-02 01:28

    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: 
    move  old_PORTABLEGIT
    mklink /J  "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.

提交回复
热议问题