Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I be checking in these gradle files?

Tags:

Should the following modified files be checked in into a repo? I am guessing not but since I am new to the tools around Java, I thought I'd ask.

    modified:   .gradle/3.5.1/fileContent/annotation-processors.bin
    modified:   .gradle/3.5.1/fileContent/fileContent.lock
    modified:   .gradle/3.5.1/taskHistory/fileHashes.bin
    modified:   .gradle/3.5.1/taskHistory/fileSnapshots.bin
    modified:   .gradle/3.5.1/taskHistory/jvmClassSignatures.bin
    modified:   .gradle/3.5.1/taskHistory/taskHistory.bin
    modified:   .gradle/3.5.1/taskHistory/taskHistory.lock
    modified:   .idea/workspace.xml

What gitignore rule will take care of any files from gradle that I don't want to check in?

I could just do a:

.gradle/

but I am worried that that might even ignore files that need to be checked in and since I am not sure, I thought it best to ask.

I did a:

.gradle/**/*.bin
.gradle/**/*.lock

but these files still show up as unstaged.

like image 621
Water Cooler v2 Avatar asked Aug 23 '17 05:08

Water Cooler v2


1 Answers

Yes, you can ignore that folder. (gitignore.io, github/gitignore)

More generally, if you were to delete the folder entirely, can you rebuild your project? If yes, you can ignore the resource regenerated by a build.

So, as a test, move .gradle/ outside of your project (backup), and rebuilt it. If the .gradle/ content is regenerated, that means it is safe to be ignored by the Git repo.

like image 59
VonC Avatar answered Oct 11 '22 13:10

VonC