update git via cmd?

In my answer, I'll show how to update Git on Windows , Linux , MacOS.

  • On Windows , open git command window and write

    git update-git-for-windows


  • On Linux, I tested the solution on [ubuntu - KaliLinux] and work correctly and based on SethMMorton comment, it wouldn’t work on Fedora, Arch, Gentoo, or a number of other Linux flavors, to apply the solution open your terminal and write these commands

    sudo add-apt-repository ppa:git-core/ppa -y

    sudo apt-get update

    sudo apt-get install git -y

    After installing, you can see your new version of git with:
    git --version


  • On MacOS view this answer update git on MacOS from terminal

If you can't run an exe due to the right restrictions, you should use the portable version ( https://github.com/git-for-windows/git/releases ).

Uncompress it in a folder and add the path of this folder in your PATH environment variable before the one of the old git. Or set it directly in GitExtensions.


Use the command:git update-git-for-windows in your git Bash console


Yes there is.

Use the command:git update-git-for-windows in your cmd and press Y and will update it.

Example:

enter image description here

PS: I don't have any admin control. It's my company computer, so you should be able to update it too