Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to upgrade Flutter: no origin repository configured

Tags:

I tried to update flutter from this command using cmd:

flutter upgrade 

And I got:

Unable to upgrade Flutter: no origin repository configured. Run 'git remote add origin https://github.com/flutter/flutter' in C:\flutter 

What is the reason and how I can solve this?

like image 223
Blasanka Avatar asked Jan 29 '20 07:01

Blasanka


2 Answers

Try flutter doctor, you will see flutter channel unknown. That is the reason, Flutter uses git to manage the Framework and when you checkout to different commit code / tags flutter channel changed to unknown.

Here is what you have to do:

flutter channel stable 

Above I mentioned stable, if you need change the channel that you want to checkout (see available channels by flutter channel in terminal / cmd).

Then:

flutter upgrade 

Everything should work now.

If not try below:

Go to flutter framework located directory and set upstream by git branch --set-upstream-to=origin/stable stable.

Please note that flutter channel stable is equivalent to git checkout stable if you try in flutter framework located directory.

Learn lot more info about this issue from already reported issue tracker.

like image 169
Blasanka Avatar answered Oct 12 '22 16:10

Blasanka


First check the flutter doctor response

when you get channel unknown, follow these steps

In Flutter framework located directory, set upstream by

  1. git branch --set-upstream-to=origin/stable stable.

  2. Then, flutter upgrade

It will fix the error

like image 22
Sankar Arumugam Avatar answered Oct 12 '22 17:10

Sankar Arumugam