I think it is a good practice to add a .gitignore to your project, to avoid bringing binary files (like .jar and .class in Java). You can check some .gitignore templates in this repository: gitignore templates
Basically, any pattern of file name you type in the .gitignore wont be considered by the git software while managing your commits.
As it is a Java project, you could just add a .gitignore in the root directory of the repository with the following content:
I think it is a good practice to add a .gitignore to your project, to avoid bringing binary files (like .jar and .class in Java). You can check some .gitignore templates in this repository: gitignore templates
Basically, any pattern of file name you type in the .gitignore wont be considered by the git software while managing your commits.
As it is a Java project, you could just add a .gitignore in the root directory of the repository with the following content: