Skip to content

Add PodFile.lock be added to the template gitignore #9299

Closed

Description

@eseidelGoogle

I notice a bunch of PodFile.lock and xcconfigs in posse commits:
https://github.com/flutter/posse_gallery/pull/2/files

They're just following from our template. Presumably our flutter create template should include a .gitignore for podfile.lock? (I highlight this not so we pick on their commit, but rather learn from it.)

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/create/ios.tmpl/.gitignore

@mit-mit?

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Apr 10, 2017
  2. Hixie commented on Apr 11, 2017

    @Hixie
    Contributor

    we should add a test that verifies that the git status is clean after "flutter create && flutter run"

  3. jason-simmons commented on Apr 11, 2017

    @jason-simmons
    Member

    flutter_tools is also generating some source files that show up as untracked files in git:
    examples/flutter_gallery/android/app/src/main/java/
    examples/flutter_gallery/ios/Runner/PluginRegistry.h
    examples/flutter_gallery/ios/Runner/PluginRegistry.m

    @jakobr-google should these files be gitignored? or can they be moved outside the app's source tree and into a build output directory?

  4. modified the milestones: , 2: Make Early Adopters happy on Apr 11, 2017
  5. mit-mit commented on Apr 19, 2017

    @mit-mit
    Member

    No, according to https://guides.cocoapods.org/using/using-cocoapods.html PodFile.lock should not be ignored: "the Podfile and Podfile.lock should always be kept under version control."

  6. mit-mit commented on Apr 19, 2017

    @mit-mit
    Member

    @jason-simmons we'll answer your question over in #9085, and let this bug track just the PodFile.lock question.

  7. mit-mit commented on Apr 19, 2017

    @mit-mit
    Member

    Closing

  8. eseidelGoogle commented on Apr 19, 2017

    @eseidelGoogle
    ContributorAuthor

    @mit-mit I'm not sure I believe that guide. The PodFile.lock has absolute paths in it:
    https://github.com/flutter/posse_gallery/pull/2/files#diff-cf4077ccb416bea5c1b3056a5a7c5299

    Are we doing something wrong? Clearly we don't want to check in absolute paths?

  9. mit-mit commented on Apr 24, 2017

    @mit-mit
    Member

    That guide is the official cocoapods guide...

    Here is another one:
    http://stackoverflow.com/questions/9446644/what-goes-into-your-gitignore-if-youre-using-cocoapods

    "The Podfile.lock must always be under source control."
    "source: I’m a member of the CocoaPods core team, like @alloy"

    However, the same stackoverflow posts also says that pods with a path dependency should be kept in source control.

    I suspect the issue here is our path dependency on engine? cc @jakobr-google

  10. alloy commented on Apr 24, 2017

    @alloy

    Indeed, CocoaPods will write relative paths to the lockfile if relative paths are used in your Podfile, so if you check in the code with your project (or otherwise guarantee the code to always be in the same relative location) this should work.

  11. mit-mit commented on Apr 24, 2017

    @mit-mit
    Member

    Thanks for the quick reply @alloy :-)

  12. 5 remaining items

  13. added a commit that references this issue on Mar 18, 2020
  14. jmagman commented on Apr 23, 2020

    @jmagman
    Member

    The Podfile.lock no longer has absolute paths in it as of #42029. Reopening.

  15. changed the title [-]Should PodFile.lock be added to our template gitignore?[/-] [+]Add PodFile.lock be added to the template gitignore[/+] on Apr 23, 2020
  16. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  17. removed this from the milestone on Jun 2, 2020
  18. removed this from the milestone on Jun 2, 2020
  19. removed this from the milestone on Aug 17, 2020
  20. jmagman commented on Oct 20, 2020

    @jmagman
    Member

    Not sure when this happened, but Podfile.lock is no longer excluded from the gitignore. I just created a new app, git inited a new project, ran flutter build ios and flutter build macos and now I see a ios/Podfile.lock and macos/Podfile.lock as an untracked (not ignored) file.

    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    	ios/Podfile
    	ios/Podfile.lock
    	macos/Podfile
    	macos/Podfile.lock
    

    Closing.

    (I know this issue was asking if it should be included at all, and it should based on CocoaPod's own docs, and now it's actually versionable).

  21. tapizquent commented on Jan 9, 2021

    @tapizquent

    I have noticed that this files along with ios/Runner.xcodeproj/project.pbxproj get updated/changed when multiple people are working in the same project.

    If I understand right, should this not be included in .gitignore? How do we handle the changes that happen in those files?

  22. jmagman commented on Jan 11, 2021

    @jmagman
    Member

    I have noticed that this files along with ios/Runner.xcodeproj/project.pbxproj get updated/changed when multiple people are working in the same project.

    ios/Runner.xcodeproj/project.pbxproj is periodically changed by Flutter to fix various behavior changes in Xcode. You should check in those changes.

    Podfile.lock should not changes between different user runs any more than pubspec.lock. Avoid running pod update in the ios directory (unless you are trying to update your dependencies). Also all your contributors should be on the same version of CocoaPods and Flutter.

  23. github-actions commented on Aug 7, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  24. locked as resolved and limited conversation to collaborators on Aug 7, 2021
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

    P2Important issues not at the top of the work listplatform-iosiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions