Skip to content

Error: Unable to find git in your PATH. on Windows 11 #159018

Closed

Description

@atang08

Steps to reproduce

Download flutter_windows_3.24.5-stable and extract to C:.

Add user environmental PATH variable:
[C:\flutter\bin
]
Moved it up so its the first one as well like the install states.

Have Git-2.47.0.2-64-bit installed. Can use git in cmd and powershell.

I tried everything to resolve this..

(I tried every git path possible...I tried this one along with:

C:\Program Files\Git\bin
C:\Program Files\Git\cmd
C:\flutter\bin\mingit\cmd
C:\flutter\bin\mingit\mingw64\bin\

I downloaded the most up to date git windows 64 bit version (2.42) and everything seems to be fine.

When running the git rev-parse HEAD:

PS C:\flutter> git rev-parse HEAD
dec2ee5c1f98f8e84a7d5380c05eb8a3d0a81668

Running where flutter:
[C:\flutter\bin\flutter
C:\flutter\bin\flutter.bat]

For my User's windows path environment variable, it includes:
flutter bin, git paths.

Actual results

When opening via command line and running "flutter", "flutter -v", "flutter doctor", "flutter.bat doctor", all results in the same error message:

Error: Unable to find git in your PATH

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Error: Unable to find git in your PATH

Activity

  1. cesarsiuu2316 commented on Nov 17, 2024

    @cesarsiuu2316

    I'm having the same problem.
    I also tried adding all folders as safe directories in the git config as follows:
    git config --global --add safe.directory '*'
    Yet, the error remains present.
    Maybe that helps.

  2. atang08 commented on Nov 17, 2024

    @atang08
    Author

    I'm having the same problem. I also tried adding all folders as safe directories in the git config as follows: git config --global --add safe.directory '*' Yet, the error remains present. Maybe that helps.

    I also tried that to no avail. I even ran the command and restarted just for the heck of it and it still does it.

    I even tried it without the ‘’.

    git config --global --add safe.directory *

    I am starting to think this has nothing to do with git but instead flutter not being able to spit out a more specific error message.

    I already gave up after hours and days wasted and what stinks is I wanted to start learning flutter because the dev community says its much a better dev experience than react native but now I am about to just forget flutter and jump on the react bandwagon

  3. cesarsiuu2316 commented on Nov 17, 2024

    @cesarsiuu2316

    Hey I managed to resolved it.
    I found the solution in this stack overflow response: stack overflow Hope it helps.
    It seems to be a very weird error involving the folder in which the cmd opens.

  4. atang08 commented on Nov 17, 2024

    @atang08
    Author

    Hey I managed to resolved it. I found the solution in this stack overflow response: stack overflow Hope it helps. It seems to be a very weird error involving the folder in which the cmd opens.

    Bless you! I tried everything but that solution and it worked!

    So basically the command processor can't have any AutoRun key registered in windows. I had one because usually I like the command prompt to be inside the current project folder I'm working on and not have to type "cd C:\project\current_project" everytime when opening.

    I wonder if flutter can fix this so people with a autorun key in their windows registry can still run smoothly.

  5. cesarsiuu2316 commented on Nov 17, 2024

    @cesarsiuu2316

    Me too, spent hours trying everything, bless the guy that found the solution too. You're welcome, btw haha. I hope that they can fix that as well, I also like the AutoRun key.

  6. added
    in triagePresently being triaged by the triage team
    on Nov 18, 2024
  7. huycozy commented on Nov 18, 2024

    @huycozy
  8. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Nov 18, 2024
  9. huycozy commented on Nov 18, 2024

    @huycozy
    Member

    I don't encounter this issue on my Windows 11. I just saw @atang08's response at #156922 (comment) with the required information (sorry somehow I missed it), so I quote it here for further insight as that issue has been closed by OP:

    I have git installed and running where git shows:
    C:\flutter\bin\mingit\mingw64\bin\git.exe
    
    Running where flutter:
    [C:\flutter\bin\flutter
    C:\flutter\bin\flutter.bat]
    

    @cesarsiuu2316: Thank you for sharing SO answer, that may be helpful to investigate this.

  10. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-windowsBuilding on or for Windows specifically
    t: flutter doctorProblem related to the "flutter doctor" tool
    team-toolOwned by Flutter Tool team
    and removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    in triagePresently being triaged by the triage team
    on Nov 18, 2024
  11. bkonyi commented on Nov 18, 2024

    @bkonyi
    Contributor

    Thanks for the details everyone, that's very helpful! Were you all able to fix the issue by clearing Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor or Computer\ HKEY_CURRENT_USER\Software\Microsoft\Command Processor?

    If so, I think this should be a relatively simple fix if we just immediately change the current directory in the script to the directory the flutter.bat script lives as soon as it's invoked and before running any commands.

  12. added
    in triagePresently being triaged by the triage team
    P2Important issues not at the top of the work list
    triaged-toolTriaged by Flutter Tool team
    and removed
    in triagePresently being triaged by the triage team
    on Nov 18, 2024
  13. self-assigned this
    on Nov 18, 2024
  14. cesarsiuu2316 commented on Nov 24, 2024

    @cesarsiuu2316

    In my case @bkonyi , I was able to fix the issue by clearing Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor.
    Hope this helps, thanks for the follow up.

  15. bkonyi commented on Nov 25, 2024

    @bkonyi
    Contributor

    In my case @bkonyi , I was able to fix the issue by clearing Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor. Hope this helps, thanks for the follow up.

    Yep, this is super helpful! I should have a fix for this in #159424.

  16. added
    r: fixedIssue is closed as already fixed in a newer version
    on Dec 3, 2024
  17. github-actions commented on Dec 17, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  18. locked as resolved and limited conversation to collaborators on Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listplatform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer versiont: flutter doctorProblem related to the "flutter doctor" toolteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions