'Error: Unable to find git in your PATH despite adding path and trying all available solutions

I have been trying to install Flutter on Windows 11 and keep on getting stuck on

Error: Unable to find git in your PATH

I have been looking around and kept on trying different ways to get it to recognise the path but nothing seems to work:

  • When installing git I made sure that the installer would add the path variables

  • I added

    C:\Program Files\Git\bin
    C:\Program Files\Git\cmd
    

    to the user paths

  • I also tried to add

    C:\Program Files\Git\bin\git.exe
    

    instead of just the folder (not actually sure which one is the better approach)

But none of this changed anything. I also tried to add

C:\Windows\System32

to the system variables but that gives me the error:

Error: PowerShell executable not found.
       Either pwsh.exe or PowerShell.exe must be in your PATH.

At this point I am out of ideas what else to do, I reinstalled git multiple times and restarted as well, always with the same result. Any help would be greatly appreciated

(also, when I type git --version I get git version 2.35.1.windows.2)



Solution 1:[1]

So this video has helped: https://www.youtube.com/watch?v=3jrmxXtK_0k

I added to my system path variables:

  1. the flutter bin file
  2. C:\Windows\System32
  3. C:\Program Files\Git\bin\git.exe
  4. C:\Program Files\Git\cmd
  5. C:\Windows\System32\WindowsPowerShell\v1.0

once all of those are added flutter does run in the console. I just have no idea it was needed when lots of other tutorials get along without it.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Another_coder