.gitignore
files
The .gitignore
file is just a regular file like any other. Your link suggests ignoring target
. If that is the only thing you want to ignore, simply create a new file called .gitignore
in the root of your repository that contains
target
then git add .gitignore
and commit.
gitignore.io
I like to use gitignore.io as a base when creating a new ignore file. They suggest the following .gitignore
for working with Java:
# Created by http://www.gitignore.io
### Java ###
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*