[英]How can I manage my projects versions using Visual Studio 2012 Professional
I am working on developing an asp.net mvc web application , using visual studio 2012 professional. 我正在使用visual studio 2012专业人员开发asp.net mvc web应用程序。 now when I want to update my project, for example by adding new features, I do the following steps:- 现在,当我想更新我的项目时,例如通过添加新功能,我执行以下步骤: -
now my current approach is some how sufficient.. but I am trying to find a more automated approach where I can for example revert certain file let say a certain .cs file to its previous version , or revert back my whole project to certain point. 现在我当前的方法是一些多么充足..但我试图找到一个更自动化的方法,我可以例如恢复某些文件让一个.cs文件到其先前的版本,或将我的整个项目恢复到某一点。
so can anyone advice how Visual studio 2012 can help me in managing my versioning ? 那么有人可以建议Visual Studio 2012如何帮助我管理我的版本控制? Thanks in advance for any help. 在此先感谢您的帮助。
Regards 问候
You'll want to use a version control system like Team Foundation Server (TFS), Git, Mercurial, Subversion, etc. I personally recommend Git. 您将需要使用Team Foundation Server(TFS),Git,Mercurial,Subversion等版本控制系统。我个人推荐Git。 Many of them have a means of integration with Visual Studio 2012 (for example, see How to Connect Visual Studio 2012 with git (github)? ). 其中许多都有与Visual Studio 2012集成的方法(例如,请参阅如何使用git(github)连接Visual Studio 2012? )。 Version control software supports features such as tracking file changes, creating code branches, merging code from different commits/users back together, etc. 版本控制软件支持诸如跟踪文件更改,创建代码分支,将来自不同提交/用户的代码合并在一起等功能。
Here's what a very simple workflow might look like with version control (see https://guides.github.com/introduction/flow/ for an example of the GitHub flow): 以下是使用版本控制时非常简单的工作流程(请参阅https://guides.github.com/introduction/flow/以获取GitHub流程的示例):
There are a few other steps you may consider for versioning such as updating the assembly information. 您可以考虑进行版本控制等一些其他步骤,例如更新装配信息。 In the AssemblyInfo.cs file there is assembly metadata specifying the assembly version, file version (or informational version, which I prefer). 在AssemblyInfo.cs文件中,有程序集元数据指定程序集版本,文件版本(或信息版本,我更喜欢)。 See What is AssemblyInfo.cs used for? 请参阅AssemblyInfo.cs用于什么? . 。 You can configure Visual Studio to auto-increment the version numbers. 您可以将Visual Studio配置为自动增加版本号。
Team Foundation Server should be available by default with VS 2012, although I'm vague on the details of setting up a TFS server to host your repositories. 默认情况下,VS 2012应该可以使用Team Foundation Server,尽管我对设置TFS服务器以托管您的存储库的细节很模糊。 Visual Studio added direct support for Git (open source, very popular) starting in VS 2013, however there is an extension available for 2012 ( https://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c ). 从VS 2013开始,Visual Studio增加了对Git(开源,非常受欢迎)的直接支持,但是有一个可用于2012的扩展( https://visualstudiogallery.msdn.microsoft.com/abafc7d6-dcaa-40f4-8a5e-d6724bdb980c ) 。 The extension allows you to perform some of the most used Git functions such as committing, branching, and pushing. 扩展允许您执行一些最常用的Git函数,如提交,分支和推送。
Here are some links to get you started: 以下是一些可以帮助您入门的链接:
Why should I use version control? 我为什么要使用版本控制?
Using Git with Visual Studio 在Visual Studio中使用Git
https://git-scm.com/download/win https://git-scm.com/download/win
https://tortoisegit.org/ https://tortoisegit.org/
https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx https://www.visualstudio.com/en-us/products/tfs-overview-vs.aspx
I use VSTS and it is fantastic. 我使用VSTS,真是太棒了。 You can use GIT or TFS version control. 您可以使用GIT或TFS版本控制。 Both are hosted by Microsoft. 两者都由微软托管。 I prefer Microsoft due to the idea of long term support and reliability. 由于长期支持和可靠性的想法,我更喜欢微软。 You can see they are supporting VS 2008 to current. 你可以看到他们支持VS 2008到现在。
https://www.visualstudio.com/team-services/pricing/ https://www.visualstudio.com/team-services/pricing/
It is also free for up to 5 users. 它最多可供5位用户免费使用。
From the link posted below. 从下面发布的链接。 It has full support for many versions of Visual Studio 它完全支持许多版本的Visual Studio
Q: Which versions of Visual Studio can I use with Visual Studio Team Services? 问:Visual Studio Team Services可以使用哪些版本的Visual Studio?
A: You can use: 答:您可以使用:
Start Visual Studio. 启动Visual Studio。 From the Team menu or Team Explorer, go to Connect to Team Foundation Server > Select Team Projects > Servers. 从“团队”菜单或“团队资源管理器”,转到“连接到Team Foundation Server”>“选择团队项目”>“服务器”。 Add your Team Services account ({youraccount}.visualstudio.com). 添加您的团队服务帐户({youraccount} .visualstudio.com)。 Select your team project, and finish connecting. 选择您的团队项目,然后完成连接。 If you get connection errors, try choosing HTTPS as your protocol. 如果出现连接错误,请尝试选择HTTPS作为协议。
https://www.visualstudio.com/en-us/docs/setup-admin/team-services/connect-to-visual-studio-team-services https://www.visualstudio.com/en-us/docs/setup-admin/team-services/connect-to-visual-studio-team-services
GIT Vs TFS Version Control - https://www.visualstudio.com/en-us/docs/tfvc/comparison-git-tfvc GIT与TFS版本控制 - https://www.visualstudio.com/en-us/docs/tfvc/comparison-git-tfvc
One thing to look into is how you visualize editing and checking in code. 需要注意的一件事是如何可视化编辑和检查代码。 I personally find that TFS version control follows a very simple and linear model. 我个人发现TFS版本控制遵循一个非常简单和线性的模型。 I prefer it to git. 我更喜欢git。 But its really Apples vs Oranges and usually people like what they are used to. 但它真的是苹果与橘子,通常人们喜欢他们习惯的东西。 I will say that Git currently is in active development and is not as feature rich as TFS-VC. 我会说Git目前正在积极开发中,并不像TFS-VC那样功能丰富。 Not to mention VSTS hooks into their entire ecosystem of plugins, build systems, test infrastructure and all of their cloud platform "Azure" 更不用说VSTS挂钩了他们整个插件生成系统,构建系统,测试基础架构以及他们所有的云平台“Azure”
If you dont need to be sharing your version controlled stuff, I like TurtleSVN. 如果你不需要分享你的版本控制的东西,我喜欢TurtleSVN。 Its simple and I like the UI it has for displaying modifications between versions. 它很简单,我喜欢用它来显示版本之间的修改。 It adds a choice on the right-click menu of any file or folder in windows explorer for "TurtleSVN" and then all of the operations can be handled from there. 它在Windows资源管理器中为“TurtleSVN”添加了任何文件或文件夹的右键菜单选项,然后可以从那里处理所有操作。
My Suggestion is still using TFS - I my project which is a product ( ASP.MVC application ) - we are using following structure in TFS.. 我的建议仍在使用TFS - 我的项目是一个产品(ASP.MVC应用程序) - 我们在TFS中使用以下结构。
we have a main branch - DEV branch a QA branch and a SP branch. 我们有一个主分支 - DEV分支一个QA分支和一个SP分支。 See screen shot attached) 见附有屏幕截图) Main Branch - Where all the code is merged using scripts - before we start with new version of development and then a new DEV branch with version is created from this main branch.. - so we have track of every version and new features added to each version... and For new client the code from Main branch is given. 主分支 - 所有代码都使用脚本合并 - 在我们开始新版本的开发之前,然后从这个主分支创建一个带有版本的新DEV分支... - 所以我们跟踪每个版本和添加到每个版本的新功能version ...对于新客户端,给出了Main分支的代码。
Dev - Based on features added we create different folder for each new set of features / enhancements and put the version. 开发 - 基于添加的功能,我们为每组新功能/增强功能创建不同的文件夹并放置版本。
SP - After development is completed - the DEV branch is freeze and we create a new branch id SP and deploy the code for QA team - any defect founs are fixed in SP and deployed to QA - once testing is done the code is SP is freeze with QA approved and deployed to main and provided to Clients.. SP - 开发完成后 - DEV分支冻结,我们创建一个新的分支ID SP并为QA团队部署代码 - 任何缺陷都在SP中修复并部署到QA - 一旦测试完成,代码就是SP冻结QA批准并部署到主要部门并提供给客户..
Finally using script - every thing from SP is merged in to Main.. and for new development - a new Branch in DEV is created from the Main.. This way we have track of enhancements / feature for each DEV phase and related SP is available and our product is getting developed in Main. 最后使用脚本 - 来自SP的所有东西都合并到Main ..并且对于新开发 - 从Main创建DEV中的新分支。这样我们就可以跟踪每个DEV阶段的增强/功能,并且相关的SP可用我们的产品在Main开发。
Hope this Helps.. 希望这可以帮助..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.