Exclude platforms folder in .gitignore

I have seen a few posts on here stating that it is recommended to put the platforms folder in your .gitignore file, however I am not sure that is the right thing for me to do.

I want to building for both iOS and Android. Currently I am working on the android project and have I have made quite a few changes in it including in the build.gradle file, added drawables and more.

It doesn’t strike me as a good idea to have all this changes only locally on my machine.

What is a good practice in such a case?

Avoiding manually modifying anything under platforms would be my suggestion.

You shouldn’t modify anything in platform directly. This is what the “hooks” directory is for - you can write your own scripts to execute/copy over before/after build/serve/etc. Therefore, you should also exclude platforms from git. Specific to gradle, cordova recommends you don’t modify it directly too.

Some other notes:
a) platform build directories get quite large (many units of magnitudes more than the main code), adding it to git causes a much larger bloat (especially if its tracking revisions in platforms)
b) There may come a time when you need to remove platforms and add it again - I’ve had this situation several times in the past writing production apps for ionic-v1, I’m pretty sure this will be true for ionic2 as well, especially when you start experimenting with different plugins and something messes up along the way

so what is the alternatives for adding a drawable for push notification or changes to the build.gradle?