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

@Assiance Assiance commented Dec 6, 2014

Thanks. You saved me some time

@AvetisG

This comment has been minimized.

Copy link

@AvetisG AvetisG commented May 2, 2015

Thank you very much for this resource!

@jesslilly

This comment has been minimized.

Copy link

@jesslilly jesslilly 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

@claudiobernasconi claudiobernasconi 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

@ghost ghost commented Nov 5, 2015

Thank you!

@hamerm

This comment has been minimized.

Copy link

@hamerm hamerm commented Nov 17, 2015

Cool, thanks!

@xitsolutions

This comment has been minimized.

Copy link

@xitsolutions xitsolutions commented May 19, 2016

Awesome! Cheers!

@prystoynyy

This comment has been minimized.

Copy link

@prystoynyy prystoynyy commented Jun 14, 2016

Good job!

@imAliAsad

This comment has been minimized.

Copy link

@imAliAsad imAliAsad commented Jun 19, 2016

Thank you bro. it helped

@carios23

This comment has been minimized.

Copy link

@carios23 carios23 commented Jul 27, 2016

Gracias!

@OswaldoMartinezMendez

This comment has been minimized.

Copy link

@OswaldoMartinezMendez OswaldoMartinezMendez commented Aug 6, 2016

Muchas gracias

@lourenco-lima-cunha

This comment has been minimized.

Copy link

@lourenco-lima-cunha lourenco-lima-cunha commented Oct 21, 2016

Thanks!

@ManGysT

This comment has been minimized.

Copy link

@ManGysT ManGysT commented Nov 6, 2016

Thank you very much=)

@sangimed

This comment has been minimized.

Copy link

@sangimed sangimed commented Nov 21, 2016

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

@bytesoftly

This comment has been minimized.

Copy link

@bytesoftly bytesoftly 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

@AbhimanyuAryan AbhimanyuAryan commented Jan 29, 2017

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

@yvsssantosh

This comment has been minimized.

Copy link

@yvsssantosh yvsssantosh commented Mar 6, 2017

Awesome!

@FreezeSoul

This comment has been minimized.

Copy link

@FreezeSoul FreezeSoul commented Mar 7, 2017

Thank you!

@josealvarez97

This comment has been minimized.

Copy link

@josealvarez97 josealvarez97 commented Mar 10, 2017

Thanks body! 💯

@danishjafri

This comment has been minimized.

Copy link

@danishjafri danishjafri commented Aug 17, 2017

Amazing, thank you!

@neoandeson

This comment has been minimized.

Copy link

@neoandeson neoandeson commented Aug 22, 2017

Thank you very much!

@mattwelke

This comment has been minimized.

Copy link

@mattwelke mattwelke commented Sep 6, 2017

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

@Maransatto

This comment has been minimized.

Copy link

@Maransatto Maransatto commented Sep 9, 2017

Obrigado!!! (in portuguese)

@bcdbuddy

This comment has been minimized.

Copy link

@bcdbuddy bcdbuddy commented Oct 20, 2017

exactly what I was looking for! thanks!

@buddhika85

This comment has been minimized.

Copy link

@buddhika85 buddhika85 commented Aug 5, 2018

Thanks

@hasanfar

This comment has been minimized.

Copy link

@hasanfar hasanfar commented Aug 5, 2018

very helpful. Thanks!

@theprajwal

This comment has been minimized.

Copy link

@theprajwal theprajwal commented Aug 12, 2018

Thanks...

@BrentACole

This comment has been minimized.

Copy link

@BrentACole BrentACole commented Sep 14, 2018

Thanks!

@wfaria

This comment has been minimized.

Copy link

@wfaria wfaria commented Sep 25, 2018

Thanks!

@andy51002000

This comment has been minimized.

Copy link

@andy51002000 andy51002000 commented Oct 27, 2018

Thanks~

@brunocicom

This comment has been minimized.

Copy link

@brunocicom brunocicom commented Nov 29, 2018

Very helpful. Thanks.

@kri-kan

This comment has been minimized.

Copy link

@kri-kan kri-kan 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

@StevenBegin StevenBegin commented Feb 18, 2019

Thanks! 👍

@CleiberReis

This comment has been minimized.

Copy link

@CleiberReis CleiberReis commented Mar 19, 2019

Thanks!

@rintaromasuda

This comment has been minimized.

Copy link

@rintaromasuda rintaromasuda commented Mar 27, 2019

Amazing! Thanks!

@taylorchasewhite

This comment has been minimized.

Copy link

@taylorchasewhite taylorchasewhite commented Apr 17, 2019

Thanks!

@franciscc

This comment has been minimized.

Copy link

@franciscc franciscc commented May 10, 2019

Thank you!

@dprutkevich

This comment has been minimized.

Copy link

@dprutkevich dprutkevich commented Jun 6, 2019

thank you, it works

@monkymn

This comment has been minimized.

Copy link

@monkymn monkymn commented Sep 5, 2019

Muchas Gracias! 👍

@faustog94

This comment has been minimized.

Copy link

@faustog94 faustog94 commented Sep 9, 2019

Thanks you!

@ricardosaracino

This comment has been minimized.

Copy link

@ricardosaracino ricardosaracino commented Oct 8, 2019

should add .idea for Rider

@gtusar

This comment has been minimized.

Copy link

@gtusar gtusar commented Oct 16, 2019

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

This comment has been minimized.

Copy link

@mohammad007kh mohammad007kh commented Feb 6, 2020

Thanks!

@sametakbal

This comment has been minimized.

Copy link

@sametakbal sametakbal commented Mar 27, 2020

Thank you !

@hoangngoclam

This comment has been minimized.

Copy link

@hoangngoclam hoangngoclam commented May 6, 2020

Thanks you very much ^_^

@Mateushrr

This comment has been minimized.

Copy link

@Mateushrr Mateushrr commented Jun 8, 2020

Thx so much!

@thestillwaters

This comment has been minimized.

Copy link

@thestillwaters thestillwaters commented Jul 1, 2020

Thx so much, your way is better than lfs.

@cristianlatapiat

This comment has been minimized.

Copy link

@cristianlatapiat cristianlatapiat commented Jul 10, 2020

Excelente Aporte , Muchas gracias.

@LassazVegaz

This comment has been minimized.

Copy link

@LassazVegaz LassazVegaz commented Sep 18, 2020

Thank you

@bantya

This comment has been minimized.

Copy link

@bantya bantya commented Jan 15, 2021

Thanks a ton.. 🙌🏽

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