How to exclude NuGet content from a control source

I know that NuGet packages (at least these days) should not be included in version control. How can I exclude files added to my project?

For example: I have a .NET MVC project that uses the NuGet package to bootstrap. It adds some CSS, JS, and font files to content, scripts, and fonts, respectively. Should these files be included in my original control? If not, what would be the best way to ignore them? (I am using GIT for this particular project.)

+4
source share
2 answers

Generally speaking, generated files should not be tracked using your source control tool. Here is a good question that addresses the pros and cons of this.

You can ignore these files and directories by creating a file .gitignorein the root of your repo.

Following the package example above, you can ignore this content by adding it to your .gitignore file:

Content
Scripts
fonts

Here are some more documents on ignoring files from Git with .gitignore.

You can also populate your .gitignore based on what the VisualStudio project uses .

+2
source

You must add it to your .gitignorefile.

:
https://github.com/github/gitignore

git .

:

enter image description here

+1

Source: https://habr.com/ru/post/1623002/


All Articles