1

I just installed Flutter SDK, And I got an error Error: Unable to find git in your PATH. when I type flutter --version in CMD.

I searched about this and I found some answers, but nothing works.

I installed SDK in D:, so I deleted it and installed it in C:\src, and I set System variable again, but still same.
And I installed Git and tried again, but failed.

I'm using Window 10.

1

6 Answers 6

3

Add path of installed git usually it is in following path,check once,the update the path

C:\Program Files\Git\cmd

to your PATH variable

After you added path,still have problem try this

You could try reinstalling Git with "Use Git and optional unix tools from the command prompt" selected in the installer.

This would add git and the unix tools to the path. You may have installed with only 'Use Git from Bash only' selected?

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

8 Comments

Can I install Git and Flutter in D:? It doesn't matter?
I am not sure,i have installed flutter in my D drive and i have installed git on default path,i have no problem using it is working perfectly,uninstall the git then install it again and update the path @JayLee
after installation and added path run git --version to check if it can access globally@JayLee
I installed git, but you mean I have to add 3 path in PATH variable? (git.exe, cmd, System32)
Not necessary but you can just add just above path only not the three path sorry about that@JayLee
|
1

Add C:\Windows\System32 to your system variable PATH

Comments

1

Solution: If the above methods don't resolve your issue, you can try adding a global Git configuration to make directory paths safe. Run the following command in your CMD:

git config --global --add core.safecrlf '*'

This will add a configuration to ensure that all directory paths are considered safe. After that, try running flutter --version again.

Comments

0

I was having everything set correctly but I was still facing the error I only had to reopen Android Studio as Administration.. I hope this works for anyone

Comments

0

I encountered this issue only in Android Studio, while running Flutter commands in Windows Command Prompt (CMD) worked fine.

To fix this, I simply ran Android Studio as an administrator, and after that, flutter doctor worked inside Android Studio without any issues.

Comments

-1

How to Solve “Unable to find git in your PATH” On Flutter?

You need to install Git using the below command line

winget install --id Git.Git -e --source winget

Add this to your PATH variable

C:\Program Files\Git\bin\git.exe;C:\Program Files\Git\cmd;C:\Windows\System32

Do not create a new variable for git but add them as I did one after another separating them by ";"

If you are windows, 10 users. we’ve tried everything but running cmd as Administrator solved my problem. This may be helpful for others.

You can also try by uninstalling and reinstall GIT to solve my problem. You can download 64-bit GIT for windows setup: https://git-scm.com/download/win

FOR WINDOWS: If you chose visual studio code during git installation and have multiple user accounts on windows then all you need to do is uninstall git and reinstall git choosing vim as the default editor, not visual studio code.

You also get a warning when choosing visual studio code during git installation.

Pay attention to that,
For me setting visual studio code as default and having multiple User accounts was the issue.

Thanks FlutterAgency.com for this help. https://flutteragency.com/unable-to-find-git-in-your-path/

Comments

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.