fatal: bad config line 1 in file .git/config
In trying to run flutter i am getting this error. I tried flutter upgrade --force, flutter channel stable as well as reinstalling flutter but none of these commands fix the error
I solved the issue by deleting the config file under flutter/.git/config and then running
git init
command in the flutter directory. Then ran flutter doctor and all is good.
Your $FLUTTER_INSTALL_DIR/.git/config
should look something like this:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/flutter/flutter.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "stable"]
remote = origin
merge = refs/heads/stable
[branch "beta"]
remote = origin
merge = refs/heads/beta
[branch "dev"]
remote = origin
merge = refs/heads/dev
Please note that this is not one of your git repos. If it doesn't look like this, reinstall flutter.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.