0

I'd like to ignore specific java class from git. So I' posted inside root .gitignore file the full path of my desired class to ignore, but this class is still tracked by git.

app/src/main/java/com/my_pack/MyActivity.class

After updating .gitignore I run git -rm cached app/src/main/java/com/my_pack/* to exclude all content of /my_pack then git add . + push back but MyActivitypersist there.

Any advices are apreciated.

p.s. using github

Mohan Radhakrishnan
  • 3,002
  • 5
  • 28
  • 42
Choletski
  • 7,074
  • 6
  • 43
  • 64
  • Note that adding a file to .gitignore will not untrack an already tracked file. You should probably ignore all .class files with `*.class`. – Code-Apprentice Oct 16 '18 at 14:51

1 Answers1

0

Before git add . run git status and follow instruction for completely remove files.
For me it work.

Redoishi
  • 68
  • 1
  • 8