How to upgrade Git on Windows to the latest version?

前端 未结 14 1615
面向向阳花
面向向阳花 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 03:52

    Git Bash

    Note, if you are instead looking to find out what version of Git Bash you are running, or want to see if you need to update Git Bash, it is part of Git for Windows.

    So your Git Bash version is:

    git --version
    

    git version 2.23.0.windows.1

    Note that it is technically different from Bash. On my same machine when I run:

    echo $BASH_VERSION
    

    4.4.23(1)-release

    Git for Windows installer

    To update to the latest version of Git and Git Bash, you can download and install the latest version of git for Windows. As per FAQ, settings/customizations should be preserved if they were installed in the appropriate configuration folders.

    Note: Their installer is actually intelligently designed to do the right thing (except for telling you that it's doing the right thing automatically). If you are doing an update, then every screen on the installer is pre-marked with the settings from your current (soon to be previous) install.

    It is not showing you generic default settings. You do not need to look any of them up, or fear for breaking your carefully honed setup. Just leave everything as is, to retain your previous choices.

    In fact, they made it even easier (if only it was clear that they did so).
    There is a checkbox at the bottom [] Show only new settings (I don't remember the exact wording). Since nothing on the first screen changes when you mark the box, it is not exactly obvious what it is for. If you mark the box, then all of your current settings will be retained, and it will skip showing those subsequent settings screens to you. Only screens with newly introduced settings will be shown.

    git update-git-for-windows

    Alternatively, as others have noted, you can also update Git Bash and Git (by definition, both are always updated at the same time) from the Git Bash command line, via:

    git update-git-for-windows  
    

    If you type git update, git kindly reminds you that the command has been updated to git update-git-for-windows:

    Warning! git update has been deprecated;
    Please use git update-git-for-windows instead.
    Git for Windows 2.26.0.windows.1 (64bit)
    Up to date

    0 讨论(0)
  • 2020-12-02 03:56

    to check out your PATH variable, act as follow:

    1. From the Desktop, right-click My Computer and click Properties.
    2. Click Advanced System Settings link in the left column.
    3. In the System Properties window click the Environment Variables button.

    Once there, scroll to get the Path row, you'll get a long string of paths (e.g. C:\windows\bin;C:\program files\git, etc)

    Find the line or lines where git is referenced. Then, make sure this path point to your Git 1.8.x installation. If not, delete it and add the real path to the newest Git version. At the end, you should only have one path in the string linking to Git.

    0 讨论(0)
  • 2020-12-02 03:57

    Based on the last response from @Simon, I first uninstalled the new version of Git. I then re-installed the new version of Git into the same directory as the old version, C:/RailsInstaller/Git, instead of the default directory C:/Git.

    Now my rails terminal window shows that I am running the new git version 1.8.0.

    0 讨论(0)
  • 2020-12-02 03:58

    if you just type

    $ git update
    

    on bash git will inform you that 'update' command is no longer working and will display the correct command which is 'update-git-for-windows'

    but still the update will continue you just have to press " y "

    if you are having issues on it run the bashh as administrator or add the 'git.exe' path to the "allowed apps through controlled folder access".

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

    If you look at the most recent update on Git's website in the "git via git" section you will see an option to update your older version.

    Here is the command that git has on their site:

    git clone https://github.com/git/git
    

    It worked for my version of git which was a 2.13.0.windows.1.

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

    If you have already installed git , you can update the git with the command git update-git-for-windows

    to know the current version use git --version

    you can run this commands in cmd prompt

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