Domanda

I am currently following this heroku tutorial , try to build something and put on heroku cloud server. but i am struggling on this point ->

https://devcenter.heroku.com/articles/getting-started-with-java#gitignore

how do I create .gitignore and prevent build artifact from going into revision control? how do I do it exactly? can anyone give some help, thanks

È stato utile?

Soluzione

.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*
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top