Ad

Flutter Channel Master Error Please Commit Your Changes Or Stash Them Before You Switch Branches

- 1 answer

i try to change a flutter channel from stable to master but i got this error when i want to change it:

git: error: Your local changes to the following files would be overwritten by checkout:
git:    packages/flutter/lib/src/material/elevated_button.dart
git: Please commit your changes or stash them before you switch branches.
git: Aborting
Switching channels failed with error code 1.

I used this flutter upgrade --force but not worked

Ad

Answer

cd into your Flutter SDK directory and run git restore .. This should remove any changes you have made to the source code on your machine.

Ad
source: stackoverflow.com
Ad