20

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
  • 363
  • 1
  • 4
  • 10

6 Answers6

41

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,828
  • 12
  • 22
  • 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
  • 5
    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
10

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
  • 1,987
  • 1
  • 23
  • 34
  • 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
4

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

  • 3
    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
2

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
  • 28,207
  • 6
  • 54
  • 78
0

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

RussKie
  • 1,630
  • 11
  • 20
0

Go to Git Bash from Start icon then execute command "git --version" and it will show Git version installed on your machine

Case 1st:

If your Git version is 2.14.1 or earlier then uninstall Git and install again from https://git-scm.com/download/win

Case 2nd:

If your Git version is 2.14.2 and 2.16.1 then use below command "git update"

Case 3rd: If your Git version is 2.16.2 or later then use below command "git update-git-for-windows"

Hope this helps. Happy Learning Thanks.

Ashish Gupta
  • 105
  • 1
  • 5