How to Create a .gitignore File for .Net

When we start a new project, we best create a Git repository right away. The only problem when we do that from the command line is that we do not get a .gitignore file. Without such a file, Git will track all files in our repository – including *.exe, *.dll, *.pdp and many more that we do not want. We could go and find a .gitignore from a different project. But there is a better way for our .Net projects:

This command creates us a .Net specific .gitignore file with these instructions:

That should get rid of all unwanted files and if something is missing, we can add it manually.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.