Flutter module code not showing up on github

475

If the repository you are pushing includes a Flutter subfolder with itself a Flutter/.git directory, then that Flutter folder would be a nested repository.

Only its gitlink (tree sha1) would be recorded, not its folder content.

You would need to git rm --cached Flutter (no trailing slash) and remove the Flutter/.git folder in order to be able to add and commit the all Flutter content.

Or you would need to use submodule in order to add Flutter as a full external repository reference: see an example in flutter/flutter issue 3770.

Share:
475
user2143094
Author by

user2143094

Updated on December 22, 2022

Comments

  • user2143094
    user2143094 over 1 year

    I have a Flutter based Android app. The app used to be completely native. Then I decided to integrate Flutter. I use the built in option in Android Studio to push my code to git. Now since the Flutter module is at the parent directory of the app, pushing to git doesn't push the flutter code. What could I do to make Android Studio push Flutter code as well so that the code can be seen on the Git repo?

  • NullByte08
    NullByte08 over 3 years
    There is no .git folder in flutter module. Still flutter module changes are not being registered.
  • VonC
    VonC over 3 years
    @NullByte08 Can you check what does git check-ignore -v -- Flutter/a-File-Inside-Flutter return?
  • NullByte08
    NullByte08 over 3 years
    fatal: not a git repository (or any of the parent directories): .git
  • NullByte08
    NullByte08 over 3 years
    I am trying git submodules now. Do I need to git init inside the flutter module directory?
  • VonC
    VonC over 3 years
    @NullByte08 the command should be executed on level above the .git folder.
  • VonC
    VonC over 3 years
    @NullByte08 And if flutter itself can be declared as a submodule within your project, then you don't need to git init it.
  • NullByte08
    NullByte08 over 3 years
    there is no .git folder inside the flutter module's directory
  • NullByte08
    NullByte08 over 3 years
  • VonC
    VonC over 3 years
    @NullByte08 If the error message reports a .git folder, there should be one (keep in mind, it is hidden by default)