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:
Tried to extract in different locations C:\flutter, in AppData etc.
Running flutter_console.bat as administrator.
cd flutter and then running the command
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:
Unzip the folder directly to where you want Flutter, or
Copy the outer folder (flutter) to include all the hidden files inside, or
Show all hidden files before selecting them and copying.
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.
you need to run
git init
so that the .git folder can be created.
once you do that flutter doctor will work as intended.
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
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.
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.
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.
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
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
Related
I did the command
flutter create --platforms=windows,macos,linux .
mistakenly under the "ios" directory.
I just wanted to add platforms to an existing flutter project.
The command above adds many config files under the wrong directory so I want them restored.
I did git reset -hard but the files are still there.
How can I revert them?
Since, you are using git and it yiu haven’t committed the changes yet, try-
git chekout .
But before doing that take a copy of your file must. Hope this will help
I'm new at GitHub and I'm having this issue: I created three private repositories for my project, all fine. On the fourth one, for some reason GitHub desktop included the node_modules folder (its an angular cli app), so I deleted the repository from GitHub.com and from GitHub desktop. When I try to recreate it, it is "cached" on my Mac, even if I copy everything to another folder, and it tries to upload the node_module files.
I also changed the name of the repository, copied all the files but node_modules folder to another folder. Same happens over and over.
I couldn't find anything on internet about this. Sorry if its a newbie question.
You could try to delete the git folder that it's being hidden by default.
Go to in file explore -Views- select "Hidden Items" and try to remove the git folder from here. After that set up your .gitignore file and pass node_modules before you use git init
Use this in your terminal, if you are using VS Code use this in the same folder you are having the problem : git config --global core.excludesfile '~/.gitignore'
I'm working with nextjs project on the vscode.
From a few days ago, debug.log file generated automatically for any directory where I'm working with.
I want to stop generating this debug.log automatically, or at least want to know how to add this debug.log to the gitignore.
I added .log, debug.log, **/debug.log, but gitignore don't works.
Maybe you need to remove cached *.log files in your project by running git rm --cached *.log, then stage your .gitignore file using git add .gitignore or you can use git add .
My reference: How to use gitignore command in git
How about adding this below one?
*.log
in your .gitignore file
Make sure "Exclude Git Ignore" is checked in settings:
this issue can be resolved by removing the (*).log what that does is make the file editable or not required
should end up looking something like this
# Logs
logs
.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
this is specifically for react but it might just work for you
uninstall then reinstall VScode worked for me.
step1: Go to Path: C:\Program Files\Microsoft VS Code
step2: run unins000.exe
step3: download and install VScode https://code.visualstudio.com/download
I want to migrate from Eclipse to Android Studio. The import works fine, but the file structure is different after import.
I followed the steps in this thread, and copied the .git directory in the root of the newly imported Android-Studio project. But git does not seem to recognize my "moved" source files but lists them as deleted and also as new files.
Old structure:
MyApp
|--src
|--com.myapp
New structure:
NewApp
|--_myApp
|--src
|--main
|--java
|--com.myapp
Is there any I can tell git to find my files without manually doing it?
Thank you, Sebastien Dawans, this was indeed the missing link. After adding with git add -u, git recognized some of my files as renamed. I wonder why not all files. Android Studio seems to touch some files while importing, which causes git to have problems identifying them. So I copied the com.myapp folder containing the java files from my eclipse folders to Android Studio folder replacing the imported files. Same with the res directory. Than git add . and git add -u
That seems to fix the issue.
I'm familiar with the differences between groups and actual directories in Xcode. I always create an actual folder in finder and drag it into the project, ensuring 'copy' is un-checked.
When I move folders, I delete the items by reference only, move them in finder, then re-add them.
Now I'm using git for the first time, and discovered in my testing that if I remove a directory using the method described above, I can't do a commit. Xcode tells me it can't switch to the directory because 'no such file or directory.' From what I've found online, git isn't notified of the directory changes when done in Xcode.
How can I move files & folders using git in Xcode 4 and have the compiler and git be aware of the moves so I can commit?
You shall not move files in a GIT repository using the Finder. You'd better use the move command from shell.
You then have to manually redresh links in XCode (or remove/add files again).
Moving a file is similar to the unix 'mv' command, with the 'git prefix:
git mv path destination
(use -f to override destination... with caution)
After you have made all your changes in the Finder, open a terminal window and navigate to your project's directory:
cd path/to/project
then run this command:
git add --all
This command will stage all of the changes and Xcode should be able to resume its management of the repository from here.