18

I recently updated my Git Extension to 3.0.2.5232 and now my git is no longer supported. When I run:

git --version 

I get

 git version 2.9.0.windows.1

However, I can't just download the latest version of git online because I can't run an .exe installer due to admin rights and what not, so is there a command I can run to upgrade directly from admin cmd?

testing
  • 345
  • 1
  • 3
  • 8

5 Answers5

38

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

mindmaster
  • 1,720
  • 10
  • 21
  • when i try this command it says "git: 'update-git-for-windows' is not a git command. See 'git --help'." – testing Mar 14 '19 at 13:31
  • 3
    That's only available since git v2.16.1 https://github.com/git-for-windows/git/releases/tag/v2.16.1.windows.2 (and since v2.14 it was call `git update`) – Philippe Mar 14 '19 at 13:48
6

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


Eng_Farghly
  • 934
  • 1
  • 14
  • 25
  • By "Linux", you mean "Debian-based Linux systems", correct? – SethMMorton Feb 24 '22 at 22:05
  • @SethMMorton, I tested the solution on Kali Linux and Ubuntu and I think the solution will work any other Debian-based Linux systems. – Eng_Farghly Feb 25 '22 at 04:37
  • Sure, but it wouldn’t work on Fedora, Arch, Gentoo, or a number of other Linux flavors. `apt` is only for Debian, so saying those instructions are for Linux without qualifying the statement is not correct. – SethMMorton Feb 25 '22 at 07:12
  • @SethMMorton, Thanks a lot for benefit information I updated the answer. – Eng_Farghly Feb 25 '22 at 11:43
3

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

  • 1
    How is this different from this [answer](https://stackoverflow.com/a/55163561/5411817) posted over 9 months earlier, which was the first answer given, and is the top voted answer. In fact while the code is the same, your post is lower quality, with less usage info, and no code highlighting. Please review help topics in [answering](https://stackoverflow.com/help/answering). SO is designed to function different than forums are designed. Here the platform relies on answers *NOT* being *repeated*! Instead any good and useful answers should be *upvoted*. This post should be deleted. – SherylHohman Feb 24 '22 at 21:46
1

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.

Philippe
  • 24,487
  • 5
  • 44
  • 70
0

Download a portable git version (https://git-scm.com/download/win), and point GE to it via Settings > Git > Paths

RussKie
  • 1,358
  • 9
  • 19