Matthew
Matthew

Reputation: 33

.gitignore is not ignoring files even if it is untracked already

I read a lot of similar articles but none of them actually solves the problem.
I have a .gitignore file that looks like this:

*.class 
 
.idea/ 
./a1-basic/build/ 
./a1-basic/.gradle/ 

I want to ignore the build folder and .gradle folder. And these two folders are not currently tracked by git.
enter image description here

However, when I run git add ., it still adds these two folders. I have tried the method found online to run git rm -r --cached .. But these folders are still added when I git add ..
Please advise what to do. Thank you

Upvotes: 2

Views: 110

Answers (1)

Tristate
Tristate

Reputation: 1821

You gitignore gradle folders like this.

# Gradle
.gradle/
build/

Upvotes: 1

Related Questions