Dart: default gitignore?

后端 未结 4 1528
一生所求
一生所求 2021-01-02 00:25

I created a new app and the Dart Editor (M4) created a slew of files and folders. Now I\'m not sure which I can safely put in the gitignore. Here\'s the tree:



        
4条回答
  •  生来不讨喜
    2021-01-02 00:59

    Dart default

    .packages      # mapping file from package names to local path
    packages       # until `--no-package-symlinks` is the default
    build/         # contains the output of `pub build`
    .pubspec.lock  # controversial - Dart guideline is to only commit
                   #     for applications but not for packages
    .pub/          # cache files generated by `pub` 
                   # .pub was moved to .dart_tool/.pub
    

    build The new https://github.com/dart-lang/build package introduces a

    .dart_tool/
    

    directory which should be excluded.

    When it comes to generated files it is generally best to not submit them to source control, but a specific Builder may provide a recommendation otherwise.

    IDE

    .idea # IntelliJ, WebStorm
    

    bazel

    /bazel-*
    .bazelify
    packages.bzl
    BUILD
    WORKSPACE
    

    See also

    • https://github.com/github/gitignore/blob/master/Dart.gitignore
    • https://www.dartlang.org/guides/libraries/private-files

提交回复
热议问题