Add PodFile.lock be added to the template gitignore #9299
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
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.)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listplatform-iosiOS applications specificallyiOS applications specificallytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Activity
Hixie commentedon Apr 11, 2017
we should add a test that verifies that the git status is clean after "flutter create && flutter run"
jason-simmons commentedon Apr 11, 2017
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?
mit-mit commentedon Apr 19, 2017
No, according to https://guides.cocoapods.org/using/using-cocoapods.html
PodFile.lockshould not be ignored: "the Podfile and Podfile.lock should always be kept under version control."mit-mit commentedon Apr 19, 2017
@jason-simmons we'll answer your question over in #9085, and let this bug track just the PodFile.lock question.
mit-mit commentedon Apr 19, 2017
Closing
eseidelGoogle commentedon Apr 19, 2017
@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?
mit-mit commentedon Apr 24, 2017
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
alloy commentedon Apr 24, 2017
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.
mit-mit commentedon Apr 24, 2017
Thanks for the quick reply @alloy :-)
5 remaining items
Update after first iOS build
jmagman commentedon Apr 23, 2020
The Podfile.lock no longer has absolute paths in it as of #42029. Reopening.
[-]Should PodFile.lock be added to our template gitignore?[/-][+]Add PodFile.lock be added to the template gitignore[/+]jmagman commentedon Oct 20, 2020
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, ranflutter build iosandflutter build macosand now I see aios/Podfile.lockandmacos/Podfile.lockas an untracked (not ignored) file.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).
tapizquent commentedon Jan 9, 2021
I have noticed that this files along with
ios/Runner.xcodeproj/project.pbxprojget 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?jmagman commentedon Jan 11, 2021
ios/Runner.xcodeproj/project.pbxprojis periodically changed by Flutter to fix various behavior changes in Xcode. You should check in those changes.Podfile.lockshould not changes between different user runs any more thanpubspec.lock. Avoid runningpod updatein theiosdirectory (unless you are trying to update your dependencies). Also all your contributors should be on the same version of CocoaPods and Flutter.github-actions commentedon Aug 7, 2021
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 -vand a minimal reproduction of the issue.