3

I eventually solved this issue (see here) but wanted to share it here so that more people see it.

Issue is that after installing Flutter on Windows, you try to run flutter doctor and get 'Unable to find git in your PATH'. This however does not happen if you are in Admin mode.

Steps to reproduce Follow all steps to install Flutter on Windows, including installing Git before hand

Make sure that git works if you type it into Powershell as a regular user. If not put the C:\Program Files\Git\cmd (or your equivalent) folder into your Windows PATH Open up Power shell as a regular / non-admin user then type flutter doctor -v. This causes the error: Error: Unable to find git in your PATH.

Now try opening in Admin mode and doing the same - it should work this time.

1
  • This question is similar to: How to solve "Unable to find git in your PATH" on Flutter?. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Sep 8, 2024 at 23:40

1 Answer 1

21

I saw a comment at the very bottom of this page, that suggested marking all your repos as 'safe' via

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

Not sure what the implication of doing so is but I went ahead and did it and now things are working properly!

Prior to this I had tried to make the flutter folder safe via:

git config --global --add safe.directory C:\Users\xxx\flutter\.git
git config --global --add safe.directory C:\Users\xxx\flutter\

but this hadn't worked.

Sign up to request clarification or add additional context in comments.

1 Comment

This did not work for me, until I removed flutter (installed with chocolatey), GIT (installed by android studio) and reinstalled both by downloading the installer from the website. Still did not work, I tried again to add the flutter folder as safe folder and now it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.