An easy way to get a default git ignore without messing about with create/copy/paste is to use the curl
command from the terminal. First cd
into your projects root directory and then run the command by replacing MY_API_NAME
with your API name from one of the following two sources:
curl -o .gitignore https://www.gitignore.io/api/MY_API_NAME
You can find your API name by searching from the list here and clicking Generate.
Java Example:
curl -o .gitignore https://www.gitignore.io/api/java
Alternatively you can use the ones at GitHub. Find the filename for your API here.
curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/MY_API_NAME.gitignore
Java Example:
curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Java.gitignore
Here are some similar alternatives for Windows.
But honestly setting that up looks like more trouble that it is worth. If I had Windows then I would just create an empty file called .gitignore
in my project's root folder and then copy and paste the default text from gitignore.io or GitHub.