Skip to content

Instantly share code, notes, and snippets.

@CatChenal
Last active May 2, 2022 15:14
Show Gist options
  • Save CatChenal/c6f615e3523352f967cc794cc9e4adc0 to your computer and use it in GitHub Desktop.
Save CatChenal/c6f615e3523352f967cc794cc9e4adc0 to your computer and use it in GitHub Desktop.
How to update git at the command line

I used to command line version given in this SO post to upgrade my current git version:

  1. Check current version:
(base) C:\Users\me>git --version
git version 2.34.1.windows.1
  1. Update if necessary, which it is for any version below 2.35 as per this offical announcement from 2022-04-12:
(base) C:\Users\me>git update-git-for-windows
  1. Immediate output & prompt (answer = y):
Git for Windows 2.34.1.windows.1 (64-bit)
Update 2.36.0.windows.1 is available
Download and install Git for Windows 2.36.0 [N/y]? y
################################################################### 100.0%
################################################################### 100.0%
  1. The installer will ask you in a separate window to authorize the modification of your system. Allow since it will remove the old version and install the new one.
  2. Wait until the installation is complete (the separate window will close).
  3. Check the new version:
(base) C:\Users\me>git --version
git version 2.36.0.windows.1
  1. Test on two existing git folders e.g., one with changes one without and run git status.
    The output should be the same one that would have come from the old version & as you expected, i.e.

"Changes not staged for commit: [...]"

and

"Your branch is up to date with x"

Final note: the installer will not change your .condarc if you have one setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment