Search code examples
gitvisual-studiovisual-studio-2015gitignore

How to gitignore the files that get generated when you compile in Visual Stuido 2015


I'm currently using the .gitignore file from GitHub but every time I compile my project in Visual Studio I get a bunch of files generated.

These are the files that get generated every time I compile.

MyApp/bin/Debug/MyApp.exe

MyApp/bin/Debug/MyApp.exe.CodeAnalysisLog.xml

MyApp/bin/Debug/MyApp.pdb

MyApp/obj/Debug/Views/MyApp.exe

MyApp/obj/Debug/MyApp.g.resources

MyApp/obj/Debug/MyApp.pdb

MyApp/obj/Debug/Views/ReportsView.baml

MyApp/obj/Debug/Views/ReportsView.g.cs

MyApp/obj/Debug/Views/ReportsView.g.i.cs

Is this normal behavior? Is there a way to include these files in my .gitignore file so they get ignored when committing changes in Git?


Solution

  • Add those 2 entries to the .gitignore file to ignore the generated files (obj and bin directories) during build

    [Oo]bj/
    [Bb]in/
    

    Now they are not shown as modified.