Back

Explore Courses Blog Tutorials Interview Questions
+4 votes
3 views
in DevOps and Agile by (19.4k points)
edited by

I have a repository with a file Hello.java. When I compile it an additional Hello.class file is generated.

I created an entry for Hello.class in a .gitignore file. However, the file still appears to be tracked.

I want to know how to make git ignore Hello.class.

1 Answer

+4 votes
by (27.5k points)
edited by

In order to ignore:

$ git update-index --assume-unchanged <path/to/file>

In order to undo ignore:

$ git update-index --no-assume-unchanged <path/to/file>

For more information:

Browse Categories

...