How Not To Show .Class Files In Git GUI

I use Git GUI to verify the changed files and changes done before submitting them. One of the problem I face is that .class, .jar & .target files gets listed in the “Unstaged Changes” and it becomes difficult to scroll down and find out the files that are actually modified, added or deleted.

To resolve this, I created a .gitignore file and placed it where .git folder is located in my workspace. For instance if I am working on a project odl-shape-service, I will have .git folder directly under the folder “odl-shape-service” and this is where I will place .gitingore file. This is how .gitignore file looks like:

Now it ignores all the files that are mentioned here i.e. .class, .jar, .lst, target folder and any files that are under target folder.

For further reference this link can be referred.


  1. Krish says

    If you have a parent folder with many ODL modules in it, use the following gitignore (on git version 2.0):

    # Eclipse project files

    # Remove all files/folders from target, except the jar file
    # reference

    # Mac files

    # Java class files

    # Yang Specific

Leave a Reply

Your email address will not be published. Required fields are marked *