Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
.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
@Assiance

This comment has been minimized.

Copy link

commented Dec 6, 2014

Thanks. You saved me some time

@AvetisG

This comment has been minimized.

Copy link

commented May 2, 2015

Thank you very much for this resource!

@jesslilly

This comment has been minimized.

Copy link

commented May 20, 2015

This is awesome. Thanksyou. You can also get a good gitignore file by using the Team Explorer view in Visual Studio. Go to the repo, go to settings, and if you do not have a .gitignore already, you can create one which looks similar to this gist.

@claudiobernasconi

This comment has been minimized.

Copy link

commented Jul 7, 2015

Thank you for sharing. It works as expected for ASP.NET MVC 4 applications.

@ghost

This comment has been minimized.

Copy link

commented Nov 5, 2015

Thank you!

@hamerm

This comment has been minimized.

Copy link

commented Nov 17, 2015

Cool, thanks!

@xitsolutions

This comment has been minimized.

Copy link

commented May 19, 2016

Awesome! Cheers!

@prystoynyy

This comment has been minimized.

Copy link

commented Jun 14, 2016

Good job!

@imAliAsad

This comment has been minimized.

Copy link

commented Jun 19, 2016

Thank you bro. it helped

@carios23

This comment has been minimized.

Copy link

commented Jul 27, 2016

Gracias!

@OswaldoMartinezMendez

This comment has been minimized.

Copy link

commented Aug 6, 2016

Muchas gracias

@lourenco-lima-cunha

This comment has been minimized.

Copy link

commented Oct 21, 2016

Thanks!

@ManGysT

This comment has been minimized.

Copy link

commented Nov 6, 2016

Thank you very much=)

@sangimed

This comment has been minimized.

Copy link

commented Nov 21, 2016

Thanks I'm gonna try it for a university project.

@bytesoftly

This comment has been minimized.

Copy link

commented Jan 2, 2017

Would add .vs/ in there too (for ignoring Visual Studio config/temp dirs)

@AbhimanyuAryan

This comment has been minimized.

Copy link

commented Jan 29, 2017

will this work with asp dotnet core MVC project as well?

@yvsssantosh

This comment has been minimized.

Copy link

commented Mar 6, 2017

Awesome!

@FreezeSoul

This comment has been minimized.

Copy link

commented Mar 7, 2017

Thank you!

@josealvarez97

This comment has been minimized.

Copy link

commented Mar 10, 2017

Thanks body! 💯

@danishjafri

This comment has been minimized.

Copy link

commented Aug 17, 2017

Amazing, thank you!

@neoandeson

This comment has been minimized.

Copy link

commented Aug 22, 2017

Thank you very much!

@mattwelke

This comment has been minimized.

Copy link

commented Sep 6, 2017

Does this work well for ASP.NET Web API projects too?

@Maransatto

This comment has been minimized.

Copy link

commented Sep 9, 2017

Obrigado!!! (in portuguese)

@bcdbuddy

This comment has been minimized.

Copy link

commented Oct 20, 2017

exactly what I was looking for! thanks!

@buddhika85

This comment has been minimized.

Copy link

commented Aug 5, 2018

Thanks

@hasanfar

This comment has been minimized.

Copy link

commented Aug 5, 2018

very helpful. Thanks!

@theprajwal

This comment has been minimized.

Copy link

commented Aug 12, 2018

Thanks...

@BrentACole

This comment has been minimized.

Copy link

commented Sep 14, 2018

Thanks!

@wfaria

This comment has been minimized.

Copy link

commented Sep 25, 2018

Thanks!

@andy51002000

This comment has been minimized.

Copy link

commented Oct 27, 2018

Thanks~

@brunocicom

This comment has been minimized.

Copy link

commented Nov 29, 2018

Very helpful. Thanks.

@kri-kan

This comment has been minimized.

Copy link

commented Dec 24, 2018

Can we commit PublishProfiles folder into source control.. As you haven'e added that to ignore list.

@StevenBegin

This comment has been minimized.

Copy link

commented Feb 18, 2019

Thanks! 👍

@CleiberReis

This comment has been minimized.

Copy link

commented Mar 19, 2019

Thanks!

@rintaromasuda

This comment has been minimized.

Copy link

commented Mar 27, 2019

Amazing! Thanks!

@taylorchasewhite

This comment has been minimized.

Copy link

commented Apr 17, 2019

Thanks!

@franciscc

This comment has been minimized.

Copy link

commented May 10, 2019

Thank you!

@dprutkevich

This comment has been minimized.

Copy link

commented Jun 6, 2019

thank you, it works

@bautiq

This comment has been minimized.

Copy link

commented Jul 6, 2019

I guess Im messing up somewhere but this is ignoring system files and breaks the whole project, for example all dll's in /bin folder which are the core of the project system files.

@monkymn

This comment has been minimized.

Copy link

commented Sep 5, 2019

Muchas Gracias! 👍

@faustog94

This comment has been minimized.

Copy link

commented Sep 9, 2019

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.