Skip to content

Instantly share code, notes, and snippets.

@indyfromoz
Created November 19, 2012 06:44
Show Gist options
  • Select an option

  • Save indyfromoz/4109296 to your computer and use it in GitHub Desktop.

Select an option

Save indyfromoz/4109296 to your computer and use it in GitHub Desktop.
.Gitignore for ASP.NET MVC
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
*.pdb
*.dll.config
*.cache
*.suo
# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll
!/packages/*/lib/*/*.dll
# Include dlls if they're in the CommonReferences directory
!*CommonReferences/*.dll
####################
# VS Upgrade stuff #
####################
UpgradeLog.XML
_UpgradeReport_Files/
###############
# Directories #
###############
bin/
obj/
TestResults/
###################
# Web publish log #
###################
*.Publish.xml
#############
# Resharper #
#############
/_ReSharper.*
*.ReSharper.*
############
# Packages #
############
# it’s better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
######################
# Logs and databases #
######################
*.log
*.sqlite
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db
[Bb]in
[Oo]bj
[Tt]est[Rr]esults
*.suo
*.user
*.[Cc]ache
*[Rr]esharper*
packages
NuGet.exe
_[Ss]cripts
*.exe
*.dll
*.nupkg
*.ncrunchsolution
*.dot[Cc]over
@ricardosaracino

Copy link
Copy Markdown

should add .idea for Rider

@gregor-tusar

Copy link
Copy Markdown

Does not the second *.dll (line 72) and packages (line 68) under # OS generated files # override whole this section (lines 12-16):

# Include dlls if they’re in the NuGet packages directory
!/packages/*/lib/*.dll
!/packages/*/lib/*/*.dll
# Include dlls if they're in the CommonReferences directory
!*CommonReferences/*.dll

?

@mohammad007kh

Copy link
Copy Markdown

Thanks!

@sametakbal

Copy link
Copy Markdown

Thank you !

@hoangngoclam

Copy link
Copy Markdown

Thanks you very much ^_^

@Mateushrr

Copy link
Copy Markdown

Thx so much!

@thestillwaters

Copy link
Copy Markdown

Thx so much, your way is better than lfs.

@cristianlatapiat

Copy link
Copy Markdown

Excelente Aporte , Muchas gracias.

@LassazVegaz

Copy link
Copy Markdown

Thank you

@bantya

bantya commented Jan 15, 2021

Copy link
Copy Markdown

Thanks a ton.. 🙌🏽

@rickluo94

Copy link
Copy Markdown

Thank you!!!

@rmohan20195

Copy link
Copy Markdown

Thank you very much, saved my day. 👍

@Knerbel

Knerbel commented Jun 23, 2021

Copy link
Copy Markdown

Thanks!

@ajru

ajru commented Sep 1, 2021

Copy link
Copy Markdown

Thanks , saved my time

@Troxar

Troxar commented Oct 5, 2021

Copy link
Copy Markdown

Thx!

@quyetkaito68

Copy link
Copy Markdown

Thank you - Cám ơn rất nhiều

@vicdant1

vicdant1 commented Mar 5, 2022

Copy link
Copy Markdown

Thank you sir :)

Hugs from Brazil 🇧🇷

@eugene-sh

Copy link
Copy Markdown

Thanks! 😊

@lemon5043

Copy link
Copy Markdown

Thanks!

@MohammedMazher1

Copy link
Copy Markdown

Thanks.....

@erikyuzwa

Copy link
Copy Markdown

Thanks so much - 2023 and it's a mystery why the dotnet new cli tool doesn't autogenerate a .gitignore to use 🤷

@mohammad-ayeshh

Copy link
Copy Markdown

ty

@TomsBack

Copy link
Copy Markdown

thaaaanks

@MohammedMazher1

Copy link
Copy Markdown

Thanks..

@vicdant1

Copy link
Copy Markdown

Hey guys, I've been recieven notifications from this post and I want to share with you a tip: instead of using this .gitignore, begin using dotnet new gitignore, cli will create a file like this and you guys don't need to come back in this gist in order to upload a new dotnet project to a git based versioning system.

@erikyuzwa

Copy link
Copy Markdown

Hey guys, I've been recieven notifications from this post and I want to share with you a tip: instead of using this .gitignore, begin using dotnet new gitignore, cli will create a file like this and you guys don't need to come back in this gist in order to upload a new dotnet project to a git based versioning system.

THIS IS BRILLIANT! Thanks for the tip @vicdant1 ❤️ 🚀

@daveleee

Copy link
Copy Markdown

Thank youuu

@GenivaldoSerra

Copy link
Copy Markdown

Muito Obrigado!

@Edgar-Rivera

Copy link
Copy Markdown

Pleno 2024 y sigue funcionando

Excelente Servicio

Att: Panchito

@tibecvp

tibecvp commented Jun 19, 2025

Copy link
Copy Markdown

Hey guys, I've been recieven notifications from this post and I want to share with you a tip: instead of using this .gitignore, begin using dotnet new gitignore, cli will create a file like this and you guys don't need to come back in this gist in order to upload a new dotnet project to a git based versioning system.

Thank you so much for sharing this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment