dotnet new gitignore (#207)

preview_player
Показать описание
A .gitnore file allows you to exclude specific files and folders from source control. Use the dotnet new gitignore command to quickly add a .gitignore to your .NET projects. Think of all the time you will save now that you don't have to Google for a .gitignore template and copy it into your project!!
Рекомендации по теме
Комментарии
Автор

A good feature but i hope one day it will be somehow extensible rather than providing the baked-in default.

And because gitignore and vscode intersected i will share this tip & rant:

What i've done in VS Code for gitignore and other 'dotfiles' for a while now is set up Custom User-level Tasks, each just a curl shell command to download a given dotfile. This way, common ones can be individually keybound so your gitignore/editorconfig/etc are just a key-combo away. The rest can be bundled into a master "get all dotfiles" Task using `dependsOn` and a "get dotfile..." Task using `pickString` or `promptString` ( i like `pickString` myself ). (I'd post links but youtube would eat my comment...)

Now, the rant: I love Custom Tasks in VS Code, but User-level Tasks in particular is what makes this work. Unfortunately, User-level tasks aren't yet synced by the inbuilt Settings Sync. So if i add a dotfile or change a URL in the above set of Tasks, or do anything else* with any Task described in the documentation as "not tied to a specific workspace or folder" - i would have to propagate changes manually as for some reason they *are* tied to a particular machine, despite being useful in any workspace or folder. 🤔🤨 Fortunately, the OG Shan Khan sync extension has me covered. ( Issue #91011 is the one to 👍 if this rant is making any sense. )

---

*) Another example of using User-level tasks similar to this is an 'add config packages' Task which will `dotnet add` half dozen or so packages in one fell swoop.

McNerdius