DEV Community

Daniel Zotti
Daniel Zotti

Posted on

#LearnedToday: .gitignore resources

.gitignore file specifies intentionally untracked files that Git should ignore.

THE PROBLEM: Whenever I start a new project, I always forget to add some files or folders...!

The gitignore github project comes to the rescue with its collection of ready-made templates that simplify the creation of the .gitignore file by adding some common files and folders to be ignored.

It is also very convenient when approaching a totally new programming language.

There is also another cool project, if you are more to create .gitignore files on the fly with a simple UI: https://gitignore.io

Top comments (2)

Collapse
 
balastrong profile image
Leonardo Montini

Thanks for sharing and here's one more!

npx gitignore [type]
Enter fullscreen mode Exit fullscreen mode

for example

npx gitignore node
Enter fullscreen mode Exit fullscreen mode

This will create a .gitignore in the current directory.


If you run npx gitignore -types it prints a list of supported types, for example node, python or rust

Collapse
 
danielzotti profile image
Daniel Zotti

Whoa..! Doing such things from the command line is even easier and faster! Thanks for sharing 😊