0

For the longest time, I had two classes of system-generated files that kept showing up in my pull requests:

  • cache files
  • test case properties file

The latter was in .gitignore

It turns out that I had them on the master branch of the repository. I followed these steps to remove them from there...

, as well as git-ignoring the cache files, which leaves my .gitignore looking like this:

.gradle

bin

Reports

Libs

output

!output/.gitkeep
build

.classpath

.project

# Added by Mike Warren
"Zoho Katalon Project/settings/internal/com.kms.katalon.composer.testcase.properties"
"Zoho Katalon Project/.cache/**/*"

This works to completely remove any cache files from my changesets (and therefore pull requests)...

...but for some odd reason, the Zoho Katalon Project/settings/internal/com.kms.katalon.composer.testcase.properties file still remains in my changeset, despite that the file is no longer part of master branch!

I keep having to say git rm --cached "Zoho Katalon Project/settings/internal/com.kms.katalon.composer.testcase.properties" just to get it out of my changeset!

enter image description here

What can I do to make sure that this file is gone for good from any change sets (present or future)?

Mike Warren
  • 3,796
  • 5
  • 47
  • 99
  • After `git rm`, did you run `git commit`? – ElpieKay Nov 28 '22 at 01:46
  • Yes, there's no instance of the file on my repository anymore. – Mike Warren Nov 28 '22 at 01:48
  • 1
    Do not use double quotes in the `.gitignore` file unless there are literal double quotes in the path name (which seems quite unlikely). – torek Nov 28 '22 at 03:48
  • What should I do if the path name contains spaces then? – Mike Warren Nov 28 '22 at 03:51
  • 1
    @MikeWarren https://stackoverflow.com/a/10213746/7976758 but see [the 1st comment](https://stackoverflow.com/questions/10213653/gitignore-ignore-files-within-a-folder-that-has-whitespace-in-the-middle#comment18790639_10213746) . Found in https://stackoverflow.com/search?q=%5Bgitignore%5D+space – phd Nov 28 '22 at 05:28

1 Answers1

0

I was able to solve this with one weird trick...

Per @phd's suggestion...

I just had to change:

"Zoho Katalon Project/settings/internal/com.kms.katalon.composer.testcase.properties"
"Zoho Katalon Project/.cache/**/*"

to:

Zoho\ Katalon Project/settings/internal/com.kms.katalon.composer.testcase.properties
Zoho\ Katalon Project/.cache/**/*

!

Mike Warren
  • 3,796
  • 5
  • 47
  • 99