- Flutter error:unable to find git path in windows
- 4 Answers 4
- How to solve “Unable to find git in your PATH” on Flutter?
- 9 Answers 9
- Unable to find git in your path #33296
- Comments
- mesl1012 commented May 24, 2019 •
- Steps to Reproduce
- mesl1012 commented May 29, 2019
- BUG IN «flutter.bat» causing «Unable to find git in your PATH» #39785
- Comments
- dbareis commented Sep 3, 2019
- susonsapkota commented Sep 7, 2019
- dbareis commented Sep 7, 2019 •
- This comment has been hidden.
- ChoiysApple commented Sep 11, 2019
- dbareis commented Sep 11, 2019 •
Flutter error:unable to find git path in windows
I’ve just tried to install Flutter on windows 10. When I try to run a flutter command ( flutter doctor ), I’m getting
I have set the path to both git and flutter and tried adding the following to path
How can I resolve this.
4 Answers 4
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?
Go to my flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (Line 33 in mine) that says
The code should look like this on those lines
Save and Run flutter doctor and everything should work fine.
I guess its something to do with the path variables being confused.
Set the path up to bin
if still not working, reinstall git
check these two threads for the further issues SO GH
Find the flutter.bat in your flutter folder which should be inside flutter/bin and edit the flutter.bat using your text editor.
Remove the below line from the file (Mine was Line 33)
The file should look like this after you remove it
Save and Run flutter doctor and everything should work fine.
I guess its something to do with the path variables being confused.
How to solve “Unable to find git in your PATH” on Flutter?
I’ve just tried to install Flutter on Linux and when I try to run a flutter command (flutter doctor), I’m getting
How can I solve this?
9 Answers 9
Install it using following command.
sudo apt-get install git
to your PATH variable
Do not create new variable for git but add them as I did one after another separating them by ;
I also got the same problem because my system didn’t had git installed. So I downloaded git from https://git-scm.com/downloads and installed it and just after installing, it worked.
just add C:\Windows\System32 to your system variable PATH. it works
You can download 64-bit Git for Windows Setup https://git-scm.com/download/win
Uninstall and reinstall GIT solved my problem.
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 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 account was the issue.
Unable to find git in your path #33296
Comments
mesl1012 commented May 24, 2019 •
Steps to Reproduce
- I am runinng windows 8.1 64 bit
- I downloaded latest flutter sdk and unzip flutter folder to drive C:\flutter
- I can use git —version command on my command prompt
- When i run the flutter_console.bat, i don’t have a problem on using flutter doctor command, but when i open a new windows console i get the error «Unable to find git in your PATH»
- I have follow everything in Issue#15047 but still cannot solve the issue. I have placed the flutter\bin path to user and system variable PATH.
- I was thinking the this command in flutter.bat «/q git» is not recognized by windows or something.
- I reinstalled git to latest version and install all unix tools with it.
- I need to fix this since vscode cannot create a flutter project because of this.
- When i run the flutter console, it wont recognize git. but with a regular windows console it can recognize git. am i missing something here?
i am running flutter —verbose create and it is the same error.
Error: Unable to find git in your path
The text was updated successfully, but these errors were encountered:
mesl1012 commented May 29, 2019
I finally resolved this issue. When i use the command echo %PATH% in my console, i don’t get the whole value since an entry had an ‘&’ character. It stops the path variable from reading onwards which stops it to process the flutter path. Try to remove the entry which stops it from reading the whole variable path.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
BUG IN «flutter.bat» causing «Unable to find git in your PATH» #39785
Comments
dbareis commented Sep 3, 2019
«git» is in my path as proven by the fact that I just used it to install flutter.
Line 38 is wrong, it says:
where /q git || ECHO Error: Unable to find git in your PATH. && EXIT /B 1
It should say:
where /q git.exe || ECHO Error: Unable to find git in your PATH. && EXIT /B 1
The results of the «where» command on my computer:
D:\TMP > where git.exe
C:\Program Files\Git\cmd\git.exe
D:\TMP > where git
Could not find git
The text was updated successfully, but these errors were encountered:
susonsapkota commented Sep 7, 2019
C:\Users\User>where git.exe
C:\Program Files\Git\cmd\git.exe
C:\Users\User>where git
C:\Program Files\Git\cmd\git.exe
Both should work just fine. Have you added git to environmental variable?
dbareis commented Sep 7, 2019 •
«where» searches the path, the working where proves it’s in the path, the failing one proves they are not the same. If you want me to specify better code that doesn’t require where I can do that also.
Who knows how many different versions of the «where» command exist.
This comment has been hidden.
ChoiysApple commented Sep 11, 2019
I just fixed this, few minutes ago.
I tried to execute flutter doctor with cmd opened with administrator privileges, not flutter_console.bat and it worked.
dbareis commented Sep 11, 2019 •
In my case it turns out I have a different version of «where.exe»:
While unusual, I won’t be the only one in this boat, proving it is always dangerous to use non-inbuilt commands to perform functions. Better to only use inbuilt windows features or commands you install.
You can replace the failing where command line with the 2 (non-comment) lines below:
:: http://dennisbareis.com/scriptingtipsandtricks/searchpath.htm
for %%E in («git.exe») do set GitFullName=%%
$PATH:E
if «%GitFullName%» == «» ECHO Error: Unable to find git.exe in your PATH (have you restarted your computer since installing GIT?). & EXIT /B 1
If the above code fails to find «git.exe» then it is definitely not in the path, and you either need to logoff & logon or shutdown & restart depending on how the path was updated.
This command displays the contents of the «PATH»:
The results should contain «C:\Program Files\Git«.