{

ignore git files in flutter and dart project


.gitignore file contains file or folder path that considered not to commit in flutter project.

Some different files or folders adds to the gitignore file in the flutter project

It creates files and folders while generating a flutter project for Android and IOS build

flutter gitignore build folder

build folder in flutter project contains outputs of a compiled flutter build application.

This folder is generated by flutter. It is not required to commit to the repository.

build/

flutter gitignore pubspec.lock

pubspec.lock is a file generated by the build.

You can add library packages pubspec.lock in gitignore file.

Application-related pubspec.lock not required to add git ignore file.

.dart_tool/
.packages
pubspec.lock # library relate lock files

Flutter Dart/Pub git ignore

dartdoc tool generates API documentation(/doc/api/) which can be added to gitignore.

pub package manager generates cache folder and pub folder that is not eligible to commit to the repository.

pub tool generates files and folder such as dart_tool, packages.

**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/

Flutter gitignore IntelliJ

If your application opens Intelli Editor, It generates some Intelli-related files.

You can add these files.

*.iml
*.ipr
*.iws
.idea/

flutter vscode gitignore

Visual studio code generates the following files for the flutter project.

.classpath
.project
.settings/
.vscode/

Flutter Android gitignore

flutter project has an android folder containing code for android related generated and native code.

It is generated by flutter SDK which can not be modified by the developer frequently.

**/android/**/gradle-wrapper.jar
.gradle/
**/android/captures/
**/android/gradlew.bat
**/android/gradlew
**/android/local.properties
**/android/key.properties
*.jks

Flutter gitignore IOS

flutter contains ios folder that contains code generated for flutter SDK.

**/ios/Flutter/.last_build_id
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig

Flutter gitignore sample example

Here is a complete example

/android//gradle-wrapper.jar .gradle/ **/android/captures/ **/android/gradlew.bat **/android/gradlew **/android/local.properties **/android/key.properties *.jks

.DS_Store .idea/ **/ios/Flutter/.last_build_id **/ios/Flutter/ephemeral **/ios/Flutter/app.flx **/ios/Flutter/app.zip **/ios/Flutter/flutter_assets/ /ios//.pbxuser /ios//.perspectivev3 /ios//*sync/ **/ios/Flutter/App.framework **/ios/Flutter/Flutter.framework **/ios/Flutter/Flutter.podspec **/ios/Flutter/Generated.xcconfig

/bin/cache/

THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
Subscribe
You'll get a notification every time a post gets published here.