# Exclude folders from sync (no .git or cache folders)

**URL:** <https://community.kinsta.com/t/exclude-folders-from-sync-no-git-or-cache-folders/1657>\
**Category:** Feature Requests\
**Created:** [August 8, 2022, 5:26pm UTC](https://community.kinsta.com/t/exclude-folders-from-sync-no-git-or-cache-folders/1657 "2022-08-08T17:26:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![philippstracker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/philippstracker/32/638_2.png) [@philippstracker](https://community.kinsta.com/u/philippstracker)\
**Post date:** [August 8, 2022, 5:26pm UTC](https://community.kinsta.com/t/exclude-folders-from-sync-no-git-or-cache-folders/1657/1 "2022-08-08T17:26:46Z")

</div>

When using “Sync \> Push to Kinsta” the local .git folder is also uploaded to the staging site. That folder is huge in some projects and should not be uploaded for several reasons

---

<div class="post-metadata">

**Author:** ![philippstracker](https://sea2.discourse-cdn.com/flex020/user_avatar/community.kinsta.com/philippstracker/32/638_2.png) [@philippstracker](https://community.kinsta.com/u/philippstracker)\
**Post date:** [August 12, 2022, 9:13am UTC](https://community.kinsta.com/t/exclude-folders-from-sync-no-git-or-cache-folders/1657/2 "2022-08-12T09:13:07Z")

</div>

I just had some issues on my staging site, because of another unexpected sync behavior:

After pushing changes from local to stage, I had many local-URLs in the website source. After quick debugging, I found that the entire cache files (generated by a plugin) were uploaded by the sync process - those files obviously contain wrong URLs.

Also, on my local site, I have two debugging plugins that I do not want to push to the hosting environment.

My suggestions:

1. Either give us an option to define folders that should not be synced -OR- do not sync any folder that ends in “cache” or starts with “.git” -OR- check if a .gitignore file exists at the local website root and only sync files that are not ignored

2. After syncing, do a “wp\_cache\_flush()” call on the updated website.

---

<div class="post-metadata">

**Author:** ![Chris](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@Chris](https://community.kinsta.com/u/Chris)\
**Post date:** [July 13, 2023, 12:29pm UTC](https://community.kinsta.com/t/exclude-folders-from-sync-no-git-or-cache-folders/1657/3 "2023-07-13T12:29:31Z")

</div>

A very good suggestion, I hope it will be included in the roadmap.
