What not to commit

    Note:Except where noted, this page discusses only source code repositories,not app deployment.Some files that you wouldn’t normally put in a repositoryare useful or essential when you deploy an app.

    Don’t commit the following files and directoriescreated by pub:

    Note: The directory, which is new in Dart 2,is used by pub and other tools. It replaces the .pub directory as ofthe 2.0.0-dev.32.0 SDK release. The .packages file replaces thepackages directories that early Dart 1.x versions produced.

    Don’t commit the API documentation directory created by dartdoc:

    For more details, read on.

    Details

    As a rule, commit only the files that people needto use your package or source code repository.Including additional files is unnecessary,could be counterproductive,and might have security implicationsif you expose details about your machine’s setup.In many source code repositories,the common practice is not to commit generated files, at all.

    To avoid committing files that arespecific to your personal workflow or setup,consider using a global ignore file(for example, .gitignore_global).

    When you use pub from within a Git repo,pub ignores the same files that Git does.For example, if you run from a Git repothat has a .gitignore file containing keys.txt,then your published package won’t contain the keys.txt file.

    The file contains a list of dependencies used by your application.Users of your code should generate their own packages informationusing .

    Note: The .packages file has replaced packages directories. For more information, see pub get.

    pubspec.lock

    The pubspec.lock file is a special case,similar to Ruby’s Gemfile.lock.

    For library packages, do not commit the file.