# s3\_sync exclude parameter does not work with folders

**URL:** <https://forum.ansible.com/t/s3-sync-exclude-parameter-does-not-work-with-folders/26354>\
**Category:** Ansible Project\
**Created:** [December 21, 2017, 12:55am UTC](https://forum.ansible.com/t/s3-sync-exclude-parameter-does-not-work-with-folders/26354 "2017-12-21T00:55:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Erik\_Daritan](https://avatars.discourse-cdn.com/v4/letter/e/4bbf92/32.png) [@Erik\_Daritan](https://forum.ansible.com/u/Erik_Daritan)\
**Post date:** [December 21, 2017, 12:55am UTC](https://forum.ansible.com/t/s3-sync-exclude-parameter-does-not-work-with-folders/26354/1 "2017-12-21T00:55:45Z")

</div>

I am trying to use s3\_sync to upload files from local git repository to S3 without the .git directory. I tried the exclude parameter with different variations such as “.git,.git/_,_.git\*/\*”

This is the line that I tested (with dummy values):

s3\_sync: aws\_access\_key=“xxx” aws\_secret\_key=“xxx” bucket=“somes3bucket” file\_root=/path/ exclude=“.git,.git/_,_.git\*/\*” mode=push delete=yes

Anyone has had any success with excluding folders?

---

<div class="post-metadata">

**Author:** ![Erik\_Daritan](https://avatars.discourse-cdn.com/v4/letter/e/4bbf92/32.png) [@Erik\_Daritan](https://forum.ansible.com/u/Erik_Daritan)\
**Post date:** [December 22, 2017, 12:02am UTC](https://forum.ansible.com/t/s3-sync-exclude-parameter-does-not-work-with-folders/26354/2 "2017-12-22T00:02:50Z")

</div>

Any thoughts or suggestions on what I can try?
