2

I want to make a complete backup of the Flutter project, and I noticed the build folder is the biggest one.

Size Details:

  • Total App Size: 889.6 MB
    • Build Directory: 743 MB
    • Remaining directories, including ios, android, assets and lib: 146 MB

I think, zipping project excluding build directory would be considered full backup and it will contain everything needed to start again.

Q. Is that correct? (if I'm wrong then is there any way to reduce app size?)

2
  • 2
    you might want to take a look at official's gitignore. Commented Oct 7, 2019 at 8:21
  • @alena as Tokenyet suggested run git init add the build folder your git ignore (git adds it automatically) and viola the build folder is not tracked nor saved.with flutter you will find yourself running flutter clean a lot which is basically deleting the build folder for a fresh build Commented Oct 8, 2019 at 4:04

3 Answers 3

1
  • Delete build folder.

  • Delete Pod folder from IOS Directory

  • .gradle folder from android Directory

  • & if you have release & build folder in Android then delete it

  • Run Command: Fluter Clean

Now Folder will be 1MB to 10MB, depending on assets folder size.

Sign up to request clarification or add additional context in comments.

Comments

1

In IntelliJ idea base ides (like Android Studio), you can get a lightweight .zip backup from your code.

Just follow this path in the top menu: File> Export> Project to Zip File

Comments

0

To start with i would suggest git versioning with an online (public or private) repository as a good way to back up your code. To answer your Question, There's absolutely no problem with leaving out the build folder, Actually almost by default git will ignore the build folder. Note that every time you compile the app, that build folder is refreshed, actually its always good to start by cleaning it

5 Comments

thanks, I've already setup local git repository, but I don't know how to back it up. I've tried to backup using git bundle and it creates an archive of 1.6 MB which is not the correct. And I tried to zip entire app, it doesn't include git files. I tried tar, and windows zip application. I want to keep git history, how do I back it up? NOTE: Don't want to use online repository, want to keep on my machine and store backup on my backup drive.
In that case ....There's absolutely no problem with leaving out the build folder.. Maybe you could try adding the path you want to back up to as your remote eg. lets call it origin2 on git bash run $ git remote add origin2 C:/path/to/my-repo something like that ,, let me know if it works.
I don't understand that, can you please explain little bit more?
I meant since you already have git ,, you can set your back up location as your "remote url" and be pushing there.
I don't want to do that, because it contains a lot of files and it is always headache to copy them from drive to drive. So zipping them is the best option for me, please tell me how can I create archive of the entire project, including git history/revisions?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.