0

I am try ignore the .idea and .gradle folders from android project while commit the code. I already added .idea and .gradle on the .gitignore file inside the app folder.

while run the command git status, It shows the files inside .idea and .gradle are showing in

Changes not staged for commit:

Here is my .gitignore file.

# idea files
.idea/

# Gradle files
.gradle/

/build
SHIDHIN TS
  • 1,557
  • 3
  • 26
  • 58

2 Answers2

2

To add already tracked file in gitignore you need to delete that file from cache. To delete from cache use this command

git rm --cached <file>

Check documentation .

To remove folder from cache use

git rm -r --cached <folder>
Abu Yousuf
  • 5,729
  • 3
  • 31
  • 50
0

if you've already commited before making the .gitignore, your .gitignore won't be taken into account for the file already commited. follow this link for more info : .gitignore after commit

Youtech code
  • 101
  • 7