How to upgrade Git on Windows to the latest version?

前端 未结 14 1617
面向向阳花
面向向阳花 2020-12-02 03:37

I just upgraded to Git 1.8.0.1 for Windows, from my previous version 1.7.9.mysysgit.0. I downloaded the new version from the Git site and installed through the normal Git in

相关标签:
14条回答
  • 2020-12-02 04:01

    Since Git 2.16.1(2) you can use

    C:\> git update-git-for-windows
    

    In version between 2.14.2 and 2.16.1, the command was

    C:\> git update
    

    (It was later renamed to avoid confusion with updating the local repository, e.g. like svn update does it.)

    That command does not exist in Git 2.13 and before.

    If this errors with "is not a git command" then either you don't actually have Git for Windows, or your version is very old.

    In which case, simply get the latest installer from https://git-scm.com/download (check whether you want 32- or 64-bit) and run it to upgrade.

    If you already have the latest version it does nothing, in which case you can manually run the installer to reinstall.

    C:\> git update-git-for-windows
    Git for Windows 2.17.0.windows.1 (64bit)
    Up to date
    
    0 讨论(0)
  • 2020-12-02 04:04

    Using the command "where git" find out how command prompt picks up the version. Once you have the path, you can go ahead and uninstall / delete previous version completely. Then if you install and make sure the new installed location is in the path, it should just work fine.

    Using git-friendly tools like cmder will make your life much easier. You don't really have to use dual boot or cygwin anymore since the support for git in windows is already top-notch now. (Git for windows installs msysgit which includes all necessary unix tools from MinGW. MinGW has been there for a while and is pretty stable. If you want you can install the full version of msysgit rather than Git for Windows. msysgit is available on Git for windows page at the bottom.)

    0 讨论(0)
  • 2020-12-02 04:10

    First, check your git version by using this command

    git version
    

    Then follow the case according to your git version

    Three cases:

    1. If your git version is 2.14.1 or earlier:

      Uninstall the git, download the latest git, and install it again.

    2. And versions between 2.14.2 and 2.16.1:

      Use command git update

    3. If the version is equal to or greater than Git 2.16.1(2):

      Use command git update-git-for-windows

    0 讨论(0)
  • 2020-12-02 04:11

    Just run:

    $ git update-git-for-windows
    
    0 讨论(0)
  • 2020-12-02 04:12

    If you are using MacOS

    To check the version

    git --version
    

    To Upgrade the version

    brew upgrade git
    
    0 讨论(0)
  • 2020-12-02 04:13

    Update (26SEP2016): It is no longer needed to uninstall your previous version of git to upgraded it to the latest; the installer package found at git win download site takes care of all. Just follow the prompts. For additional information follow instructions at installing and upgrading git.

    0 讨论(0)
提交回复
热议问题