You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Proposal]Generated windows files should be git ignored by default #100291
Just run a flutter project for web or android it will still generate files needed for windows build
Expected results:
Supposedly the build files only for specific files should be generated.
Actual results:
Windows related build files are also generated even when we just ran the app on web or android platform.
Not much details required, I just would like flutter team to please add the build files related to windows into .gitignore automatically just like it is done for other ones else it is a bit of a frustrating thing for one to discard them. Yeah one can put them manually into .gitignore and that is what I am doing currently but what if one doesn't knows that even ? 😅
No code sample required running any flutter app will reproduce this issue.
The names of additional 2 files are mentioned below :
generated_plugin_registrant.h
generated_plugins.cmake
I don't think so that any code will be needed specifically to reproduce this issue or if any logs would help in debugging the same if needed please do let me know in the comments and I will edit and add the required code/log output below.
Hi @Ldev007, Thanks for filing the issue. I believe this is working as intended generated_plugin_registrant.h, generated_plugins.cmake and generated_plugin_registrant.cc all these three files are generated when flutter pub get is executed, so regardless of which platform you are compiling the app for, they will be generated.
Regarding adding them to gitignore, that does look like a valid proposal to me, since all those three are generated files. Labeling this issue as a proposal to gitignore those three files.
Reacted by ritchie, Noel Huibers and Alishan Tesch
changed the title [-]generated_plugin_registrant.cc should be git ignored including 2 more files[/-][+]Generated windows files should be git ignored by default[/+]on Mar 17, 2022
changed the title [-]Generated windows files should be git ignored by default[/-][+][Proposal]Generated windows files should be git ignored by default[/+]on Mar 17, 2022
Hi! Are there any news on this subject? I would also like to know if ignoring the generated files can cause any harm to the project. in this doc recommends to ignore these files.
#116581 does this for the main flutter repo itself.
I think the proper solution is that rather than .gitignore these, we should really generate them into the ephemeral build directory when we create them in the tool as we do for builds targeting mobile platforms.
Re-opening since while gitignoring them is the right answer, doing that by generating these files in the right place (under the ephemeral build dir) is the proper solution.
When you build your Windows app, the Flutter tool should place all files that aren't meant to be edited by the user in the windows\flutter\ephemeral directory. The generated_plugin_registrant.cc and generated_plugin_registrant.h files should be moved to this directory as well.
Shouldn't windows/flutter/ephemeral be in the default .gitignore?
I have run the app on windows and now this folder is 288 MB of size. If it doesn't have to go into git, it would be great if it is in .gitignore when we create new projects.
Activity
maheshj01 commentedon Mar 17, 2022
Hi @Ldev007, Thanks for filing the issue. I believe this is working as intended
generated_plugin_registrant.h,generated_plugins.cmakeandgenerated_plugin_registrant.ccall these three files are generated whenflutter pub getis executed, so regardless of which platform you are compiling the app for, they will be generated.Regarding adding them to gitignore, that does look like a valid proposal to me, since all those three are generated files. Labeling this issue as a proposal to gitignore those three files.
[-]generated_plugin_registrant.cc should be git ignored including 2 more files[/-][+]Generated windows files should be git ignored by default[/+][-]Generated windows files should be git ignored by default[/-][+][Proposal]Generated windows files should be git ignored by default[/+]AucaCoyan commentedon Jun 6, 2022
Hi! Are there any news on this subject? I would also like to know if ignoring the generated files can cause any harm to the project. in this doc recommends to ignore these files.
cbracken commentedon Jan 12, 2023
#116581 does this for the main flutter repo itself.
I think the proper solution is that rather than .gitignore these, we should really generate them into the
ephemeralbuild directory when we create them in the tool as we do for builds targeting mobile platforms.cbracken commentedon Jan 13, 2023
Re-opening since while gitignoring them is the right answer, doing that by generating these files in the right place (under the ephemeral build dir) is the proper solution.
Sarraj-Sahar commentedon Mar 9, 2023
@cbracken can I please ask what you mean by "generating these files into the ephemeral build directory "? How can I achieve that?
loic-sharma commentedon Mar 24, 2023
When you build your Windows app, the Flutter tool should place all files that aren't meant to be edited by the user in the
windows\flutter\ephemeraldirectory. Thegenerated_plugin_registrant.ccandgenerated_plugin_registrant.hfiles should be moved to this directory as well.carloswm85 commentedon Nov 10, 2023
Is there any news with this?
I'm still getting these files every time.
And adding them to
.gitignorejust does not work.I will be trying to add them to
.gitignore_globaland see if it works (short tutorial about this).gokturkDev commentedon Sep 13, 2024
lea108 commentedon Oct 24, 2025
Shouldn't windows/flutter/ephemeral be in the default .gitignore?
I have run the app on windows and now this folder is 288 MB of size. If it doesn't have to go into git, it would be great if it is in .gitignore when we create new projects.
Edit: the vast majority of size comes from: