DEV Community

Cover image for VS Code Tip of the Week: Add a gitignore via VS Code
Nick Taylor Subscriber for VS Code Tips

Posted on • Edited on • Originally published at community.vscodetips.com

31 3

VS Code Tip of the Week: Add a gitignore via VS Code

This week's tip of the week is coming from my old coworker @citizen428. On one my streams on livecoding.ca, I show you how you can add a gitignore file to a project via npx gitignore.

Little did I know this is baked into VS Code!

Press CTRL + Shift + P (CMD + Shift + P on macOS) to open the command palette.

Type in Add gitignore in the command palette.

Add gitignore typed into VS Code's command palette

You'll be presented with a language to generate the gitignore file for.

The Add gitignore command in VS Code's command palette prompting the user to select a language to generate the gitignore for

And there you go! You have a fresh gitgnore file in your repository now!

gitignore file for node.js generated from the Add gitignore command in VS Code

Happy VS Coding!

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (3)

Collapse
 
codercatdev profile image
Alex Patterson

Nice I always google for this, constantly forget it is there!

Collapse
 
francisprovost profile image
Francis Provost

I'm usually going to gitignore.io but that's a really great alternative!

Collapse
 
antongeorgiev profile image
Anton Georgiev

You need to have the gitignore VS Code extension installed before you can type Add gitignore in the command palette.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay