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 commented Dec 6, 2014

Thanks. You saved me some time

@AvetisG

This comment has been minimized.

Copy link

AvetisG commented May 2, 2015

Thank you very much for this resource!

@jesslilly

This comment has been minimized.

Copy link

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 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 commented Nov 5, 2015

Thank you!

@hamerm

This comment has been minimized.

Copy link

hamerm commented Nov 17, 2015

Cool, thanks!

@xitsolutions

This comment has been minimized.

Copy link

xitsolutions commented May 19, 2016

Awesome! Cheers!

@prystoynyy

This comment has been minimized.

Copy link

prystoynyy commented Jun 14, 2016

Good job!

@imAliAsad

This comment has been minimized.

Copy link

imAliAsad commented Jun 19, 2016

Thank you bro. it helped

@carios23

This comment has been minimized.

Copy link

carios23 commented Jul 27, 2016

Gracias!

@OswaldoMartinezMendez

This comment has been minimized.

Copy link

OswaldoMartinezMendez commented Aug 6, 2016

Muchas gracias

@lourenco-lima-cunha

This comment has been minimized.

Copy link

lourenco-lima-cunha commented Oct 21, 2016

Thanks!

@ManGysT

This comment has been minimized.

Copy link

ManGysT commented Nov 6, 2016

Thank you very much=)

@sangimed

This comment has been minimized.

Copy link

sangimed commented Nov 21, 2016

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

@bytesoftly

This comment has been minimized.

Copy link

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 commented Jan 29, 2017

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

@yvsssantosh

This comment has been minimized.

Copy link

yvsssantosh commented Mar 6, 2017

Awesome!

@FreezeSoul

This comment has been minimized.

Copy link

FreezeSoul commented Mar 7, 2017

Thank you!

@josealvarez97

This comment has been minimized.

Copy link

josealvarez97 commented Mar 10, 2017

Thanks body! 💯

@danishjafri

This comment has been minimized.

Copy link

danishjafri commented Aug 17, 2017

Amazing, thank you!

@neoandeson

This comment has been minimized.

Copy link

neoandeson commented Aug 22, 2017

Thank you very much!

@mattwelke

This comment has been minimized.

Copy link

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 commented Sep 9, 2017

Obrigado!!! (in portuguese)

@bcdbuddy

This comment has been minimized.

Copy link

bcdbuddy commented Oct 20, 2017

exactly what I was looking for! thanks!

@buddhika85

This comment has been minimized.

Copy link

buddhika85 commented Aug 5, 2018

Thanks

@hasanfar

This comment has been minimized.

Copy link

hasanfar commented Aug 5, 2018

very helpful. Thanks!

@theprajwal

This comment has been minimized.

Copy link

theprajwal commented Aug 12, 2018

Thanks...

@BrentACole

This comment has been minimized.

Copy link

BrentACole commented Sep 14, 2018

Thanks!

@wfaria

This comment has been minimized.

Copy link

wfaria commented Sep 25, 2018

Thanks!

@andy51002000

This comment has been minimized.

Copy link

andy51002000 commented Oct 27, 2018

Thanks~

@brunocicom

This comment has been minimized.

Copy link

brunocicom commented Nov 29, 2018

Very helpful. Thanks.

@kri-kan

This comment has been minimized.

Copy link

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 commented Feb 18, 2019

Thanks! 👍

@CleiberReis

This comment has been minimized.

Copy link

CleiberReis commented Mar 19, 2019

Thanks!

@rintaromasuda

This comment has been minimized.

Copy link

rintaromasuda commented Mar 27, 2019

Amazing! Thanks!

@taylorchasewhite

This comment has been minimized.

Copy link

taylorchasewhite commented Apr 17, 2019

Thanks!

@franciscc

This comment has been minimized.

Copy link

franciscc commented May 10, 2019

Thank you!

@dprutkevich

This comment has been minimized.

Copy link

dprutkevich commented Jun 6, 2019

thank you, it works

@bautiq

This comment has been minimized.

Copy link

bautiq 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

monkymn commented Sep 5, 2019

Muchas Gracias! 👍

@faustog94

This comment has been minimized.

Copy link

faustog94 commented Sep 9, 2019

Thanks you!

@ricardosaracino

This comment has been minimized.

Copy link

ricardosaracino commented Oct 8, 2019

should add .idea for Rider

@gtusar

This comment has been minimized.

Copy link

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 commented Feb 6, 2020

Thanks!

@sametakbal

This comment has been minimized.

Copy link

sametakbal commented Mar 27, 2020

Thank you !

@hoangngoclam

This comment has been minimized.

Copy link

hoangngoclam commented May 6, 2020

Thanks you very much ^_^

@Mateushrr

This comment has been minimized.

Copy link

Mateushrr commented Jun 8, 2020

Thx so much!

@thestillwaters

This comment has been minimized.

Copy link

thestillwaters commented Jul 1, 2020

Thx so much, your way is better than lfs.

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.