What should be stored in source control for an Asp.Net Core MVC application?

。_饼干妹妹 提交于 2019-12-19 05:23:32

问题


With the new Asp.net Core MVC projects such as:

There are a lot of unfamiliar folders there, like bower_components, wwwroot, Dependencies, etc..

What should be stored in source control?


回答1:


Anything that is a project setting, or that you directly change you should store. Anything that is directly downloaded (references, bower/node) or is directly based on those (lib folder getting copied by gulp) should be ignored.

So, in your case, ignore bower, node, and project\wwwroot\lib. You want the wwwroot folder if you have custom css or js.




回答2:


I went with

(With green being yes, red being no)

The only unlisted exception was the .xproj (and for TFS the .xproj.vspscc).

I deleted the folder from my local workspace (after backing up to somewhere else) and restored from source control and everything seems to behave as it should, once all the packages restored themselves.

This assumes that the gulpfile.js is configured to move the needed css, js, font components into wwwroot.

Also since I wrote this, there is a launchSettings.json within the properties folder that I've source controlled (Not sure why it's only just generated).


My .tfsignore file is currently:

project\wwwroot
!project\wwwroot\web.config
project\node_modules
project\bower_components

(which seems to be OK so far, but would potentially change if other static resources such as JS, CSS and Images were added in.)



来源:https://stackoverflow.com/questions/35411417/what-should-be-stored-in-source-control-for-an-asp-net-core-mvc-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!