How you can use gitignore.io to generate files to be ignored by git

How you can use gitignore.io to generate files to be ignored by git

For the moment, I am working on automation in different projects based on C# and Java.

Compiled Languages

When you build the projects for testing, a lot of files are created as they are compiled languages. They not directly important in the code repository and can safely be ignored. We usually do the same for third party libraries such as node_modules when using NodeJS.

Potential Conflicts

As a software develop, I mainly code by experimenting. One way of doing this is by regularly stashing and checking out of branches. I therefore have plenty of files roaming around whereby file conflicts can arise. As a result, this can hamper my development speed.

In technologies that I'm not particularly comfortable with such as Specflow for automation or Maven Projects in Java, I'm not sure which files or directories I can safely add to the gitignore file.

For instance, I recently had a target folder appearing for each build I made in a Java Project. I surfed on StackOverflow to see if this directory should be committed; it should not. However, even if I added it to the gitignore file, the target folder still appeared in my Git GUI client namely Git Fork.

GitIgnore

Solution

Nevertheless, one interesting answer or comment pointed to a website called gitignore.io. I heard about it before but didn't find it relevant so far because most projects I've worked on for the past few years were already created by a Technical Lead. Apart from the idea folder from Jetbrains IDEs, I rarely needed to add anything. Not this time for sure.

I went on the website, selected my Operating System, Programming Language and Framework. I copied and pasted the created gitignore file in the project.

Voila.