git和ASP MVC

use*_*339 17 git asp.net-mvc gitignore

有人知道用git和建立新项目的好文章ASP.NET MVC吗?

只是想知道包含什么ignore以及如何处理部署.

Dan*_*rza 36

Gitignore

您询问了要忽略的内容 - 这是ASP.NET MVC项目的默认.gitignore:

###################
# 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
Run Code Online (Sandbox Code Playgroud)

设置一个新项目

有关设置新项目的帮助,我会安装msysgit,因为你最有可能在Windows上并查看learn.github以了解如何开始使用git.当然,大师(Skeet)建议你从控制台做大部分事 - 我倾向于同意他的看法.GIT就这么简单恕我直言.如果您想要一个方便的git引用,请查看git参考.

部署

正如其他人已经提到的那样 - 请查看AppHarbor的部署情况.那些家伙的目标是成为"ASP.NET的Heroku".

  • +1谢谢你.两个建议:首先,您可以在`*.suo`之后添加`*.user`,因为它们是用户特定的文件(https://github.com/github/gitignore/blob/master/Global/VisualStudio.gitignore) .第二,**最重要的**,在`!/ packages/*/lib/*.dll`之后添加`!/ packages/*/lib/*/*.dll`.今天,在尝试部署到AppHarbor并让我的构建失败时,我被此感到厌烦.过了一会儿,我终于想到一些NuGet包(比如WebActivator和Ninject)在`lib`下使用文件夹结构(即`/ packages/Ninject.2.2.1.4/lib/net40-Full/Ninject.dll`).希望这有助于他人! (4认同)
  • Dan,现在NuGet支持[包恢复](http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages),子目录中的DLL实际上不再是问题; 你只需忽略**整个文件夹**(即`packages /`),NuGet将在构建时为你下载缺少的软件包.如果那里没有所有那些DLL,那么repo大小会急剧下降(我的重量减轻了47 MB​​!) (3认同)

Dav*_*uda 4

今天在codebetter.com上有一篇很棒的帖子.这是关于OSS项目,但我敢打赌它也适用于你,因为它描述的是GIT.

本文的右侧部分是Kyle博客的链接,尤其是Windows上的Git和GitHub入门.