MJ Sabri
MJ Sabri

Reputation: 477

The Flutter Directory Is Not A Clone of GitHub Project

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

Flutter Error

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:

  1. Tried to extract in different locations C:\flutter, in AppData etc.
  2. Running flutter_console.bat as administrator.
  3. cd flutter and then running the command

Upvotes: 31

Views: 34091

Answers (9)

Abdallah Mahmoud
Abdallah Mahmoud

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

Midriaz
Midriaz

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

W.Man
W.Man

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

Gustave Dupre
Gustave Dupre

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

ncoder83
ncoder83

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

Dirk Gooris
Dirk Gooris

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

Anshul Verma
Anshul Verma

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

Shahim Sadakath
Shahim Sadakath

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

Barlow Tucker
Barlow Tucker

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:

  1. Unzip the folder directly to where you want Flutter, or
  2. Copy the outer folder (flutter) to include all the hidden files inside, or
  3. Show all hidden files before selecting them and copying.

Upvotes: 126

Related Questions