Skip to content

[Proposal]Generated windows files should be git ignored by default #100291

Description

@Ldev007

Steps to Reproduce

  • 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 :

  1. generated_plugin_registrant.h
  2. 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.

Activity

  1. maheshj01 commented on Mar 17, 2022

    @maheshj01
    Member

    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.

  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    platform-windowsBuilding on or for Windows specifically
    c: proposalA detailed proposal for a change to Flutter
    a: buildBuilding flutter applications with the tool
    and removed
    in triagePresently being triaged by the triage team
    on Mar 17, 2022
  3. 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
  4. 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
  5. added
    P3Issues that are less important to the Flutter project
    on May 31, 2022
  6. AucaCoyan commented on Jun 6, 2022

    @AucaCoyan

    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.

  7. cbracken commented on Jan 12, 2023

    @cbracken
    Member

    #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.

  8. cbracken commented on Jan 13, 2023

    @cbracken
    Member

    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.

  9. Sarraj-Sahar commented on Mar 9, 2023

    @Sarraj-Sahar

    @cbracken can I please ask what you mean by "generating these files into the ephemeral build directory "? How can I achieve that?

  10. loic-sharma commented on Mar 24, 2023

    @loic-sharma
    Member

    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.

  11. carloswm85 commented on Nov 10, 2023

    @carloswm85

    Is there any news with this?

    I'm still getting these files every time.

    image

    And adding them to .gitignore just does not work.

    image

    I will be trying to add them to .gitignore_global and see if it works (short tutorial about this).

  12. gokturkDev commented on Sep 13, 2024

    @gokturkDev
  13. added
    fyi-toolFor the attention of Flutter Tool team
    team-windowsOwned by the Windows platform team
    and removed
    team-toolOwned by Flutter Tool team
    on Jul 11, 2025
  14. lea108 commented on Oct 24, 2025

    @lea108

    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:

    • flutter_windows.dll.pdb (252 MB)
    • flutter_windows.dll (42 MB)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: buildBuilding flutter applications with the toolc: proposalA detailed proposal for a change to Flutterplatform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-windowsTriaged by the Windows platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions