1

I am writing a flutter app, the pubspec.lock file always been conflict after I checked into this file to git version control. I already searching from the web that told me it is better to put the pubspec.lock file to version control. In Dart and Pub, should I add pubspec.lock to my .gitignore?

is it possible to avoid the pubspec.lock file conflict? I am delete the pubspec.lock file and regenerate it right now because I did not know how to merge the lock file. how about add the pubspec.lock to .gitigore? I hate to put this file to version control.

Dolphin
  • 29,069
  • 61
  • 260
  • 539

1 Answers1

0

If you are working on an application package, then you should keep the pubspec.lock file in your repository as a snapshot of your dependencies.

Application packages should check their lockfiles into source control, so that everyone working on the application and every location the application is deployed has a consistent set of dependencies.

see more Detail Glossary of package terms

My Suggestion to you not add in .gitigore file. Thanks You.

Vasoya Jemish
  • 191
  • 1
  • 10