Reputation: 477
I had downloaded Flutter from https://flutter.io/setup-windows/ (flutter_windows_v0.5.1-beta.zip) in windows 10 and followed the guidelines, extracted the zip in C:\Users\M. Junaid and opened flutter-console.bat. I tried to run flutter doctor but got the following
Error: The Flutter directory is not a clone of the GitHub project.
The flutter tool requires Git in order to operate properly;
The to set up flutter, run the following command:
git clone -b beta https://github.com/flutter/flutter.git
Re-checked the dependencies Git and PowerShell which are correctly installed and path variable is also correct - C:\Users\M.Junaid\flutter\bin
I Tried These But Nothing Worked:
Upvotes: 31
Views: 34091
Reputation: 937
1- delete old flutter folder sdk, unzip the fresh version
2- Open the unzip folder of flutter sdk, then check the files hidden of ".git" to be visible, by runing command of visible the files , by open termnail and cd to path of folder :
defaults write com.apple.Finder AppleShowAllFiles true
Upvotes: 0
Reputation: 190
This mistake also raises when flutter has '!' in a file path. https://github.com/flutter/flutter/issues/26571
So you need to rename a folder with '!' in its name.
Worked for me, while other solution didn't help.
Upvotes: 1
Reputation: 705
In your case, you might forget some hidden files like below (Github project does have .git directory), when you copy/move extracted content from flutter_windows_v0.5.1-beta.zip to C:\Users\M. Junaid.
.cirrus.yml
.codecov.yml
.git
.gitattributes
.github
.gitignore
.idea
.pub-cache
Upvotes: 0
Reputation: 119
I was having this problem even using git to download it. The solution was to change the folder name from .github to .git In windows I did the following.
rename .github .git
Upvotes: 8
Reputation: 183
you need to run
git init
so that the .git folder can be created.
once you do that flutter doctor will work as intended.
Upvotes: 5
Reputation: 21
The flutter script checks whether there is a .git
directory in the working directory. If this directory is not in place, then the message is seen as reported.
So double-check for the presence of this directory. If it is not there, you may need to re-clone the repository.
Upvotes: 2
Reputation: 377
I solved this by using this command:
git clone -b beta https://github.com/flutter/flutter.git
(Note: make sure you have git installed.)
After that, try to open flutter_console.bat
and type any flutter command to check whether it is installed properly or not.
Upvotes: 11
Reputation: 11
I had same issue with Flutter 1.0. I solved it by running the following command:
git clean -xfd
This deletes all existing files and re-creates them again in another folder.
Upvotes: 0
Reputation: 6529
Flutter checks for a git folder, which is normally a hidden folder. If you copied and pasted the contents of the zip file, there is a good chance that you missed copying this hidden folder.
You can solve this by doing one of the following:
flutter
) to include all the hidden files inside, orUpvotes: 126