Touring Plugins – GitIgnore
I always have a .gitignore file in my Dropbox folder that I copy over for new projects, knowing that any subsequent update to the copy isn’t always synced with the original. Of course, it’s not always necessary either, but it’s something that’s always bugged me.
Recently I ran across a plugin for IntelliJ IDEA (and family) that solves my issue with ignore files.
It’s called GitIgnore Support and as its name suggests it provides support for .gitignore files, but it goes way beyond what you’d imagine at first. Let’s take a look.
Generating an ignore file from templates
The plugin connects to GitHub’s template repository for file patterns and displays a list of templates from which we can create an initial ignore file.
If using IntelliJ IDEA or family, there’s a specific template named JetBrains which is most suited. We can get to this by creating a new file (Cmd+N on OSX 10.5) and selecting the .gitignore (it actually suggests to create one for new projects).
The templates have a series of file and directory masks commented out which we can fine-tuning based on our needs.
Adding existing items from project
At any time, if we want to ignore a file or folder that is in the project view, we can right click and select Add to .gitignore
Syntax highlighting and inspections
In addition to generating and keeping the ignore file for us, the plugin also provides syntax highlighting and what’s more interesting, inspections, allowing for duplicate detection or entries that we actually think are doing something but in reality are not, something I’ve had headaches with occasionally.
For every inspection, and in fact every entry, it offers an Intention to remove the entry
The plugin is definitely useful for both existing projects that we’d want to update or clean up the ignore file, and even more interesting for new projects, since as mentioned previously, it prompts us to create the corresponding ignore file, something I personally often forget to do until that first staging.
It is open source and the code is available on GitHub
Subscribe to Blog updates
The Best of IntelliJ IDEA’s HTTP Client
In today's fast-paced tech world, easy and efficient management of web services and APIs is crucial. That's where IntelliJ IDEA's HTTP Client steps in, turning complex HTTP requests into a walk in the park. The HTTP Client is a feature-rich, text-based tool in IntelliJ IDEA Ultimate. It seamlessl…
Profile Java and Kotlin Code with the IntelliJ Profiler
At JetBrains, we believe that profiling Java and Kotlin code should be simple and accessible to all developers, regardless of their level of expertise. That’s why the IntelliJ Profiler puts ease of use and seamless integration at the forefront of its mission. In previous releases, we introduced a r…
History of Gradle Delegation Process in IntelliJ IDEA
Nowadays, a build tool is an essential part of any project, and IntelliJ IDEA integrates with the majority of them. Among the most popular build tools is Gradle. We’d like to give a brief historical overview of its integration with IntelliJ IDEA and the delegation process implemented inside the I…
How to Work With Protobuf-Maven Projects in IntelliJ IDEA
Protobuf, short for Protocol Buffers, is a language-agnostic data serialization format developed by Google. It is designed to efficiently and reliably serialize structured data to communicate between different systems and programming languages. Protobuf offers a compact binary representation of data…