How to update installed Git【Git for Windows】

How to update Git for Windows

Method

Run git update-git-for-windows on PowerShell.

Execution example

Execution

PS C:\Users\username> git update-git-for-windows
Git for Windows 2.30.0.windows.2 (64bit)
Update 2.35.2.windows.1 is available
Download and install Git for Windows 2.35.2 [N/y]? y
################################################################################################################ 100.0%
################################################################################################################ 100.0%
PS C:\Users\username>

How to get help

PS C:\Users\username> git update-git-for-windows -h
Usage: git update-git-for-windows [options]
Options:
        -g, --gui Use GUI instead of terminal to prompt
        -y, --yes Automatic yes to download and install prompt
Return code:
 0: no update available
         1: update available and user selected not to update
         2: update available and it was started