首先查看当前安装Git的版本:

PS D:\> git -v

git version 2.42.0.windows.2
  • 2.17.1版本之前执行命令:git update

  • 2.17.1版本之后执行命令:git update-git-for-windows