Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Your flutter checkout has local changes that would be erased by upgrading." when running flutter upgrade

I recently decided to run flutter upgrade, but after starting, the command terminal states:

Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove local changes, then re-run this command with "--force".

I don't know what it means by "local changes." I'm not very familiar with git and do not generally need to mess with it explicitly. I'm concerned that I'm going to mess something up if use "--force."

Is there a way I can check what these changes are/were first? It's probably some local configuration change that I forgot about.

like image 345
Nerdy Bunz Avatar asked Aug 31 '25 10:08

Nerdy Bunz


1 Answers

A slightly more complete answer, so that you can see what changes have actually been made to your local flutter environment:

cd ~/development/flutter #or wherever you installed flutter
git diff HEAD

In my case, git reminded me that I had added '--disable-web-security' to packages/flutter_tools/lib/src/web/chrome.dart which is what I suspect will be a very common local change.

git stash #if you like, or just remember your changes
flutter upgrade --force #to upgrade flutter

Now you can put your local changes back, assuming you still want them.

like image 109
Peter Williams Avatar answered Sep 03 '25 00:09

Peter Williams