Anyone still facing the same issue, and the below comment should not solve it.
Try this, as it happens to solve it on my end:
Open File Explorer and go to:
C:\Windows\System32
Look for a file named git
(no extension, or maybe git.exe
).
If you find it:
Rename it to git.old
Or delete it if you're sure it is not needed.
In PowerShell, run:
$gitPath = "C:\Program Files\Git\cmd" [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$gitPath", "User")
Then restart PowerShell, that's it, that's all