# Exclude platforms folder in .gitignore

**URL:** <https://forum.ionicframework.com/t/exclude-platforms-folder-in-gitignore/102007>\
**Category:** ionic-v3\
**Created:** [August 15, 2017, 9:23am UTC](https://forum.ionicframework.com/t/exclude-platforms-folder-in-gitignore/102007 "2017-08-15T09:23:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bartrbrand](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@bartrbrand](https://forum.ionicframework.com/u/bartrbrand)\
**Post date:** [August 15, 2017, 9:23am UTC](https://forum.ionicframework.com/t/exclude-platforms-folder-in-gitignore/102007/1 "2017-08-15T09:23:58Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [August 15, 2017, 6:47pm UTC](https://forum.ionicframework.com/t/exclude-platforms-folder-in-gitignore/102007/2 "2017-08-15T18:47:38Z")

</div>

> [@bartrbrand](#):
>
> What is a good practice in such a case?

Avoiding manually modifying anything under `platforms` would be my suggestion.

---

<div class="post-metadata">

**Author:** ![pliablepixels](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/pliablepixels/32/112372_2.png) [@pliablepixels](https://forum.ionicframework.com/u/pliablepixels)\
**Post date:** [August 15, 2017, 7:12pm UTC](https://forum.ionicframework.com/t/exclude-platforms-folder-in-gitignore/102007/3 "2017-08-15T19:12:03Z")

</div>

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](https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#configuring-gradle).

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

---

<div class="post-metadata">

**Author:** ![bartrbrand](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@bartrbrand](https://forum.ionicframework.com/u/bartrbrand)\
**Post date:** [August 15, 2017, 7:32pm UTC](https://forum.ionicframework.com/t/exclude-platforms-folder-in-gitignore/102007/5 "2017-08-15T19:32:28Z")

</div>

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