Eclipse git gitignore file is ignored

I have an Android project in which I want GIT to ignore the bin and gen folders. Therefore, I placed the following .gitignore file in the project directory (I also tried it at a higher level):

# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
#.classpath
#.project

Unfortunately, this file is ignored by Eclipse, and I continue to write files and .class files from gen / and bin /. I also tried marking the folders as “Suppose it hasn't changed,” but that also doesn't help.

I'm not sure, but it is possible that I added the file AFTER the first commit.

+4
source share
2 answers

, gen bin. .gitignore , - , . bin gen:

git rm -r --cached bin gen
git commit -m "removed generated files"
+12

:

git rm -r --cached ./projectname/bin 

0

Source: https://habr.com/ru/post/1502610/


All Articles