# .gitignore is ignored - content in ignored directories is still included in commits

**URL:** <https://forum.katalon.com/t/gitignore-is-ignored-content-in-ignored-directories-is-still-included-in-commits/29735>\
**Category:** Integrations\
**Tags:** integrations, katalon-studio\
**Created:** [July 16, 2019, 8:15pm UTC](https://forum.katalon.com/t/gitignore-is-ignored-content-in-ignored-directories-is-still-included-in-commits/29735 "2019-07-16T20:15:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmeyer](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bmeyer/32/8197_2.png) [@bmeyer](https://forum.katalon.com/u/bmeyer)\
**Post date:** [July 16, 2019, 8:15pm UTC](https://forum.katalon.com/t/gitignore-is-ignored-content-in-ignored-directories-is-still-included-in-commits/29735/1 "2019-07-16T20:15:38Z")

</div>

The .gitignore for our project is similar to the template provided via [.gitignore template for Katalon Studio](http://forum.katalon.com/t/gitignore-template-for-katalon-studio/9793)

Here are the exact contents:

```
settings/*
.DS_Store
/bin/
/Libs/
/.settings/
/.classpath
.svn/
Reports/

```

However, when changes are made to files in the above locations (specifically with settings and Reports/), those changes are still pushed to git. This leads to having to fix merge conflicts about timestamps in the settings directory in many of our merges.

Is there something we are missing about how .gitignore is setup?

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [July 16, 2019, 8:20pm UTC](https://forum.katalon.com/t/gitignore-is-ignored-content-in-ignored-directories-is-still-included-in-commits/29735/2 "2019-07-16T20:20:52Z")

</div>

Try the following for your settings and Reports directories:

```
.settings
/Reports

```

This has always worked for me.

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [July 16, 2019, 9:08pm UTC](https://forum.katalon.com/t/gitignore-is-ignored-content-in-ignored-directories-is-still-included-in-commits/29735/3 "2019-07-16T21:08:41Z")

</div>

Let’s say you have already added/committed some files (`.settings` and `Reports`) to your git repository and you then add them to your `.gitignore`; these files will still be present in your repository index.

`.gitignore` is not effective to those files which were already added to the index. If you want to ignore them, you need to remove those files out of the index.

In order to get rid of `.settings` and `Reports`, you need to do the following:

```auto
$ git rm -r --cached .settings
$ git rm -r --cached Reports

```

See [http://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore/](http://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore/)
