gitignore git files in flutter and dart project

.gitignore file contains a file or folder path that is considered not to commit in a 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 the 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.


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.

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 a cache folder and pub folder that is not eligible to commit to the repository.

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


Flutter gitignore IntelliJ

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

You can add these files.


flutter vscode gitignore

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


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.


Flutter gitignore IOS

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


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


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
You'll get a notification every time a post gets published here.