I am working on a project that has grown to a decent size, and I am the only developer. We currently don't use any version control, but I definitely need to start.
我正在开发一个已经发展到相当规模的项目,我是唯一的开发人员。我们目前不使用任何版本控制,但我绝对需要启动。
I want to use Subversion. What would be the best way to transfer an existing project to it?
我想使用Subversion。将现有项目转移到它的最佳方法是什么?
I have a test server that I use for developing new features, then transfer those files to the 2 production servers. Is there a tool that will automate the upload to the test, then the deployment to the live servers?
我有一个测试服务器,我用它来开发新功能,然后将这些文件传输到2个生产服务器。是否有一个工具可以自动上传到测试,然后部署到实时服务器?
All this is developed in ASP.NET using Visual Studio (if that matters)
所有这些都是使用Visual Studio在ASP.NET中开发的(如果这很重要)
22 个解决方案
#1
16
To expand a little on the previous answer...
在前一个答案上稍微扩展一下......
1) Create a new SVN repository
2) Commit all the code you've worked on so far to it
3) Check all that code OUT again, to create a working copy on your dev machine
4) Work!
1)创建一个新的SVN存储库2)提交你目前为止所做的所有代码3)再次检查所有代码OUT,在你的开发机器上创建一个工作副本4)工作!
It's definitely not a hurdle, really.
这绝对不是一个障碍,真的。
#2
7
I didn't see anybody addressing this part of your question/post:
我没有看到有人解决你的问题/帖子的这一部分:
Is there a tool that will automate the upload to the test, then the deployment to the live servers?
是否有一个工具可以自动上传到测试,然后部署到实时服务器?
One gotcha is that Subversion creates hidden .svn folders in your working copy. One of the solutions is to use the svn export command. That will make a copy of your repository on another directory without the .svn folders.
一个问题是Subversion在您的工作副本中创建隐藏的.svn文件夹。其中一个解决方案是使用svn export命令。这将在没有.svn文件夹的另一个目录中创建存储库的副本。
As far as I know there is no automated tool for this. You can create a batch file that will issue the svn export command like this:
据我所知,没有自动化工具。您可以创建一个批处理文件来发出svn export命令,如下所示:
svn export C:\MyReporitosy\Path C:\DestinationPath
Just include this as part of your deployment process. Make sure to deploy your code from this exported directory and not your working copy. You should be fine then.
只需将此作为部署过程的一部分。确保从此导出目录而不是工作副本部署代码。那你应该没问题。
#3
4
+1 for Matt Howell's answer.
为Matt Howell的回答+1。
I don't know how many times I've added a new project by creating the directory in the repo, Importing the new project into it, then Checking it out again. This is why Matt's answer is best:
我不知道有多少次我通过在repo中创建目录,将新项目导入其中,然后再次检出来添加新项目。这就是Matt的答案最好的原因:
-
I create a project called FRED and do some work
我创建了一个名为FRED的项目并做了一些工作
-
I create a directory in SVN repo, and import FRED into it.
我在SVN repo中创建一个目录,并将FRED导入其中。
-
But the FRED directory is still not under source control - it lacks .svn files, so I need to check it out, into a new directory, let's call it FRED-NEW, recreating all the files
但FRED目录仍然没有源代码控制 - 它缺少.svn文件,所以我需要检查它,进入一个新目录,让我们称之为FRED-NEW,重新创建所有文件
-
I then need to delete FRED, leaving me nervous something's got lost or corrupted along the way.
然后我需要删除FRED,让我感到紧张的一些东西在途中丢失或损坏。
As Matt says, check out a step earlier, while the folder in the SVN repo is still empty:
正如Matt所说,请先检查一下,而SVN仓库中的文件夹仍为空:
-
Create a directory in SVN AND CHECK IT OUT into FRED-NEW.
在SVN中创建一个目录并将其检查到FRED-NEW。
-
Copy FRED-NEW/.svn into FRED/
将FRED-NEW / .svn复制到FRED /
-
Right-click Add all the files. FRED is now under source control without recreating and deleting.
右键单击“添加所有文件”。 FRED现在处于源代码控制之下,无需重新创建和删除。
Still better:
-
Create a directory in SVN, and BEFORE adding files to it, check the empty directory out DIRECTLY INTO FRED.
在SVN中创建一个目录,在向其添加文件之前,检查空目录直接进入FRED。
-
Right-click Add all files.
右键单击“添加所有文件”。
Also if you're using CLI and didn't think of this until after committing the new files, see alroc's answer below: --force when checking out into FRED.
此外,如果您使用CLI并且在提交新文件之前没有想到这一点,请参阅下面的alroc答案: - 在结账时使用FRED。
#4
3
Import your existing base into a SVN repository, check it back out and begin working again.
将现有基础导入SVN存储库,将其检出并重新开始工作。
#5
3
You should look at Visual SVN, which integrates seamlessly into Visual Studio.
您应该查看Visual SVN,它可以无缝集成到Visual Studio中。
#6
2
Technical issues aside, just get SVN and start using it. You will see the immediate benefits (looking at code history, diff-debugging to see what change introduced the bug that was not present last week), and you will never want to look back.
除了技术问题,只需获取SVN并开始使用它。您将看到直接的好处(查看代码历史记录,差异调试以查看上周未提供的错误引入了什么更改),您永远不会想要回顾。
I, personally, do not like my source control integrated in the IDE. I use Tortoise SVN that integrates with Windows Explorer and lets you check in, diff, merge, etc files straight from the OS.
我个人不喜欢我在IDE中集成的源代码控制。我使用与Windows资源管理器集成的Tortoise SVN,让您直接从操作系统检入,差异,合并等文件。
#7
2
No SVN server required.
Use Tortoise Mercurial http://sourceforge.net/project/showfiles.php?group_id=199155
无需SVN服务器。使用Tortoise Mercurial http://sourceforge.net/project/showfiles.php?group_id=199155
Setup local repo
1) Download and Install
2) Open an explorer window to the base directory of you project
3) Right-Click -> TortoiseHG -> Create Repository Here -> Ok
4) Right-Click -> HG Commit...
5) Type your commit comment, select which files to track, and click Commit
设置本地存储1)下载并安装2)打开资源管理器窗口到项目的基本目录3)右键单击 - > TortoiseHG - >在此创建存储库 - >确定4)右键单击 - > HG提交... 5 )键入您的提交注释,选择要跟踪的文件,然后单击“提交”
Setup remote repo over file share (other transport methods available)
1) Open explorer window to remote folder
2a) Right-Click -> TortoiseHG -> Clone a Repository
2b) Alternatively, just copy your local repo over
在文件共享上设置远程仓库(可用的其他传输方法)1)打开资源管理器窗口到远程文件夹2a)右键单击 - > TortoiseHG - >克隆存储库2b)或者,只需复制本地仓库
Updating remote repo after committing local
1) Open explorer window to remote folder
2) Right-Click -> TortoiseHG -> Synchronize
3) Select "Update to new tip" in Pull menu
4) Enter the path to your local repo into the "Remote Path:" input box 5) Click Pull
提交本地后更新远程仓库1)打开资源管理器窗口到远程文件夹2)右键单击 - > TortoiseHG - >同步3)在“拉”菜单中选择“更新到新提示”4)在“远程”中输入本地仓库的路径路径:“输入框5”单击“拉”
#8
1
Subversion Server install... Subverison Client Libraries instal...
Subversion服务器安装... Subverison客户端库安装...
Install Ankh for integration with VS Install Tortoise for File Manager integration
安装Ankh以与VS Install Tortoise集成以进行文件管理器集成
In File Manager, right click on top level direction with Solution... Import...
在文件管理器中,右键单击顶层方向,解决方案...导入...
#9
1
I wondering why you had chosen Subversion? If your project is not using any vc, may be you should consider to use Mercurial or Git either.
我想知道你为什么选择了Subversion?如果您的项目没有使用任何vc,可能您应该考虑使用Mercurial或Git。
Their stronger point is that they don't need a central repository, that means that your programmers can checkout your project, go to their home, work (without having to have a connection to your servers), and the next day come back to the office and sync their repositories.
他们更强调的一点是,他们不需要*存储库,这意味着您的程序员可以检查您的项目,去他们家,工作(无需连接到您的服务器),第二天回到办公室并同步他们的存储库。
If SVN is not a mayor requirement, i recommend to consider any of both dvc systems.
如果SVN不是市长要求,我建议考虑任何一个dvc系统。
#10
0
It may be overkill for what you require but creating a SVN repository on one machine, and then on another setting up an contious integration server. TeamCity is one I would recommend. (you may also be able to use virtual PC for this if hardware is at a premium)
对于您的需求可能过度,但在一台机器上创建SVN存储库,然后在另一台机器上创建一个连续的集成服务器。 TeamCity是我推荐的。 (如果硬件非常宝贵,您也可以使用虚拟PC)
This will allow you to add the custom build steps to deploy onto the production servers once a build is complete and tested.
这将允许您在完成构建并进行测试后添加自定义构建步骤以部署到生产服务器上。
TeamCity for more information. Thi also provides a plugin into Visual Studio as well
TeamCity了解更多信息。 Thi还为Visual Studio提供了一个插件
#11
0
It is easy to start using Subversion. Download TortoiseSVN, which integrates SVN into Windows Explorer. Download AnkhSVN for VS integration. Set up svnserve as a Windows Service (it's in the docs).
使用Subversion很容易。下载TortoiseSVN,它将SVN集成到Windows资源管理器中。下载AnkhSVN for VS集成。将svnserve设置为Windows服务(它位于文档中)。
Then all you do is check out an empty directory from svn and copy all your code files into it. Then add them with Tortoise, and commit. When you change files in Visual Studio, Ankh will show you which files you've changed and you can commit them there.
然后你要做的就是从svn查看一个空目录并将所有代码文件复制到其中。然后用Tortoise添加它们,并提交。当您在Visual Studio中更改文件时,Ankh将向您显示您已更改的文件,并且您可以在那里提交它们。
We do all our deployment with NAnt scripts, although you may find batch scripts and xcopy sufficient.
我们使用NAnt脚本完成所有部署,尽管您可能会发现批处理脚本和xcopy足够。
#12
0
I'm more familiar with Perforce than subversion, but putting a project under version control is not at all hard.
我对Perforce比对subversion更熟悉,但是将项目置于版本控制之下并不困难。
Once you've installed and got your version control software running, clean out your code directory of everything that isn't a source (for instance, run 'make clean'). Then use just use the command to add new files to your repository, recursively. Follow that by a submit, and you are done. I recommend checking out onto a different machine and building at least once to make sure you have everything you need to build.
一旦安装并运行了版本控制软件,就清理掉所有非源代码的代码目录(例如,运行'make clean')。然后使用命令以递归方式将新文件添加到存储库。通过提交来完成,您就完成了。我建议您至少检查一台不同的机器并进行一次构建,以确保您拥有构建所需的一切。
As for deploying onto servers, that's not really a version control problem. You would typically either put that into your build system (i.e. 'make testinstall', 'make install') or just write shell scripts.
至于部署到服务器上,这不是真正的版本控制问题。您通常会将其放入构建系统(即'make testinstall','make install')或只编写shell脚本。
#13
0
+1 on the answers provided by Joe and Steve.. I would also mention that it is important to set up your ignore lists or SVN Props so that you don't check in user files, resharper setting.
关于乔和史蒂夫提供的答案+1。我还要提到设置忽略列表或SVN道具很重要,这样就不会检查用户文件,resharper设置。
Also make sure you include everything that may be needed for the build, such as build scripts, 3rd party assemblies, external tools such as nunit, nant etc
还要确保包含构建所需的所有内容,例如构建脚本,第三方程序集,外部工具(如nunit,nant等)
While you are at it, I would highly recommend you look at CC.net, and getting continuous integration server installed to automate your build.
当你在这里时,我强烈建议你看看CC.net,并安装持续集成服务器来自动化你的构建。
Having source control is one thing, using it properly is another entirely. Remember to check in frequently and early.
拥有源代码控制是一回事,正确使用它是另一回事。请记得经常提前入住。
#14
0
The easy answer is Subversion along with Tortoise SVN.
简单的答案是Subversion和Tortoise SVN。
I've used Subversion with visual studio, and I've implemented it with an existing project. There is a free Visual Studio plugin called Ankh, which I used with some success. However, I have had some issues where Ankh refuses to stay in sync with the real state of the files as reflected in the .svn metadata (it did things like insist a file needed to be updated when tortoise would show me it was up to date). In these instances, a visual studio restart fixed the issues, but that is painful and tedious for me.
我已经将Subversion与visual studio一起使用,并且我已经使用现有项目实现了它。有一个名为Ankh的免费Visual Studio插件,我用了一些成功。但是,我遇到了一些问题,其中Ankh拒绝与.svn元数据中反映的文件的真实状态保持同步(它确实需要更新文件,因为当乌龟会告诉我它是最新的时候需要更新)。在这些情况下,视觉工作室重新启动修复了问题,但这对我来说是痛苦和乏味的。
Currently, I stopped using Ankh and just work my project as normal in VS and then use Tortoise and windows explorer to check them in/out. This works flawlessly. No VS refreshes or restarts necessary.
目前,我停止使用Ankh并在VS中正常工作我的项目,然后使用Tortoise和Windows资源管理器来检查它们。这完美无瑕。没有VS必须刷新或重新启动。
#15
0
1) Create a new repository - you can create it on the test server and later transfer it to a dedicated server/NAS if it makes things simple for you. 2) Import all your existing source code into the repository. 3) You can create using the 'svn' command line tool (and its related tools, like svnadmin) a batch file which will automate the upload and deployment process (the latter combined with the compiler of course).
1)创建一个新的存储库 - 您可以在测试服务器上创建它,然后将其传输到专用服务器/ NAS(如果它对您来说简单)。 2)将所有现有源代码导入存储库。 3)您可以使用'svn'命令行工具(及其相关工具,如svnadmin)创建一个批处理文件,该文件将自动执行上载和部署过程(后者与编译器结合使用)。
You can find more information here: SVN book - just start read it - you don't need to read it all to start and get svn running. MSBuild - a build automation platform by microsoft, although it may be an overkill, depening on the size of your project.
你可以在这里找到更多信息:SVN书 - 只需开始阅读它 - 你不需要全部阅读以启动并运行svn。 MSBuild - 微软的构建自动化平台,虽然它可能是一种过度杀伤,取决于你的项目规模。
If you have Visual Studio on the same computer as the batch file, you may use it to compile your solution, although I'm suspecting you'll hit scaling problems in the future.
如果Visual Studio与批处理文件在同一台计算机上,您可以使用它来编译您的解决方案,尽管我怀疑您将来会遇到扩展问题。
#16
0
Version control and deployment are two separate issues (although a good version control system can make the deployment a more consistent, reproducible process). Once you have your version control server set up you can use a set of simple script/batch files to automate checking the code out and deploying it to the server.
版本控制和部署是两个独立的问题(尽管良好的版本控制系统可以使部署成为更一致,可重复的过程)。设置版本控制服务器后,可以使用一组简单的脚本/批处理文件自动检查代码并将其部署到服务器。
#17
0
To add to the previous answers, I would recommand also the obvious (but they should be made explicit) advices:
为了增加以前的答案,我还建议明显(但应该明确)建议:
- choose a stable state of your project to import in your repository (whatever tool you choose)
- create immediately a label (or tag in SVN), once the import is done and 'checked' (like 'does it compile ?', 'have we get all setting files needed ?', ...)
- think about the different 'development efforts' you will need to do during the lifecycle of this project, and that will get you a good idea of what your branches should look like.
(maintenance branch for an old version already in production while your are developing the next version, merge branch to isolate complicated merges, patch branches, ...)
选择要在您的存储库中导入的项目的稳定状态(您选择的任何工具)
一旦导入完成并“检查”(如'编译?','我们是否需要所有设置文件?',...),立即创建标签(或SVN中的标签)
想一想在这个项目的生命周期中你需要做的不同的“开发工作”,这将让你很好地了解你的分支应该是什么样子。 (正在开发下一个版本的旧版本的维护分支,合并分支以隔离复杂的合并,补丁分支,...)
Now, beware:
Is there a tool that will automate the upload to the test, then the deployment to the live servers?
是否有一个工具可以自动上传到测试,然后部署到实时服务器?
That part of your question refers to a 'release management' process, and that is very different that 'version management'.
I am not sure the version tool you will choose can help actively. Especially when you consider there should be no version control tool on a production server (in order to keep the dependency of a production server with any tool to a minimum: only monitoring and reporting tool should be allowed, in addition of course of your programm - here a web server for instance -)
您的问题的这一部分涉及“发布管理”过程,这与“版本管理”非常不同。我不确定您选择的版本工具是否可以积极帮助。特别是当您考虑生产服务器上不应该有版本控制工具时(为了将生产服务器与任何工具的依赖关系保持在最低限度:只允许监控和报告工具,除了您的程序之外 - 这里是一个Web服务器 - )
#18
0
in addition to all the other comments about the practicalities of getting the project under source control I'd encourage you to take a look at Streamed Lines: Branching Patterns for Parallel Software Development as guide to code line and branching policies - might save you some re-work later.
除了关于将项目置于源代码控制下的实用性的所有其他评论之外,我还建议你看一下流线:并行软件开发的分支模式作为代码行和分支策略的指南 - 可能会为你节省一些 - 稍后工作
Also Eric Sink had a great collection of posts introdcing the various source code control concepts - Source Control HOWTO
此外,Eric Sink收集了很多帖子,介绍了各种源代码控制概念 - Source Control HOWTO
#19
0
I have recently started to love the simplicity of Bazaar to solve the problem of starting version control after already having hacked on an application for a while.
我最近开始喜欢Bazaar的简单性来解决在已经攻击应用程序一段时间后启动版本控制的问题。
With bazaar it is really only a few simple commands: 1) bzr init 2) bzr add [the files you are interested in] 3) bzr commit
有了集市,它实际上只有几个简单的命令:1)bzr init 2)bzr add [你感兴趣的文件] 3)bzr commit
Note that this does not setup any central repository. But you can do that as well.
请注意,这不会设置任何*存储库。但你也可以这样做。
Regarding using it as a deployment tool I am quite sure I read something about it not long ago. The documentation is really good anyway.
关于使用它作为部署工具,我很确定我不久前读过它。无论如何,文档真的很棒。
#20
0
The question is clearly on Subversion (SVN is the alias).
问题显然在于Subversion(SVN是别名)。
These are the steps:
这些是步骤:
1) Create a New Repository (if needed, if using VisualSVN Server then very easy)
2) Right click on the Folder of which you want to put the folders and files into your repository
3) With having the right click menu go to TortoiseSVN
4) Choose IMPORT
5) Place in trunk (best practice)
e.g. https://computername:8443/svn/MyCoolCode/trunk
#21
-1
I use mercurial on my desktop and I love it. Creating the repository is super easy...
我在桌面上使用mercurial,我喜欢它。创建存储库非常容易......
hg init /path/to/repository
Add the files...
添加文件...
hg add /folder/pattern
OR
hg add FILE
Then you just commit...
然后你就承诺......
hg commit
And you're up and running.
而且你已经开始运转了。
The other great thing is when I want to sync to my laptop it's just...
另一件好事是,当我想要同步到我的笔记本电脑时,它只是......
hg pull //desktop_name/path/to/repo/
hg update
The thing that I like about subversion is the pluggin for Visual Studio, I stay on top of my updates more when the status icons are starring me in the face all of the time. The pluggin may definitely make up for the hassel of setting the svn repository up if you're going to be working with the one project a lot.
我喜欢颠覆的东西是Visual Studio的插件,当状态图标一直在面对我时,我会更多地关注我的更新。如果你要经常使用一个项目,插件肯定可以弥补设置svn存储库的麻烦。
#22
-1
The question was focused clearly towards an existing project. I have not yet found an appropriate answer in this thread and played around until I had the solution. The hassle comes when you checkout, as described in many answers, and you end up with a second versioned folder, your existing project remains unversioned and you are reluctant to copy/paste and/or rename your folders.
这个问题明确地针对现有项目。我还没有在这个帖子中找到一个合适的答案,并且在我有解决方案之前一直玩。结账时会遇到麻烦,如许多答案中所述,最终你得到了第二个版本化文件夹,你现有的项目仍然是无版本的,你不愿意复制/粘贴和/或重命名你的文件夹。
The solution to this problem is as follows:
该问题的解决方案如下:
Suppose you have a bunch of projects in PC1, all collected as subfolders under a folder named "Projects" and you want to version all of them in one repository. Then you would like to check it out on PC2 with the same folder structure. Then you do the following:
假设您在PC1中有一堆项目,所有项目都被收集为名为“Projects”的文件夹下的子文件夹,并且您希望在一个存储库中对所有这些项目进行版本控制。然后你想在具有相同文件夹结构的PC2上查看它。然后执行以下操作:
- Create a folder for your repository on the network drive and make sure that it is named "Projects", i.e. the same name as the parent folder of your development projects. For example create a folder like X:\Repository\Projects on a network drive.
- Right Click on this folder and choose TurtoiseSVN -> Create Repository Here
- Right Click on your development "Projects" folder on PC1 (your existing project) and press TurtoiseSVN -> Import. Choose the correct repository with the name "Projects" (in case you already have other repositories on the network drive). Now your projects are at the disposal for other PC's.
- Make a parent folder on PC2 where you want to have the "Projects" folder.
- Right Click on this Parent Folder on PC2 and choose SVN Checkout. The projects are now available on PC2.
- From now on, you use "commit" to store changes in the repository and "update" to get the latest version from the repository.
在网络驱动器上为您的存储库创建一个文件夹,并确保它名为“Projects”,即与开发项目的父文件夹同名。例如,在网络驱动器上创建类似X:\ Repository \ Projects的文件夹。
右键单击此文件夹,然后选择TurtoiseSVN - > Create Repository Here
右键单击PC1(现有项目)上的开发“Projects”文件夹,然后按TurtoiseSVN - > Import。选择名称为“Projects”的正确存储库(如果您已在网络驱动器上安装了其他存储库)。现在您的项目可供其他PC使用。
在PC2上创建一个父文件夹,您想要“Projects”文件夹。
右键单击PC2上的此父文件夹,然后选择SVN Checkout。这些项目现在可在PC2上使用。
从现在开始,您使用“commit”存储存储库中的更改并“更新”以从存储库中获取最新版本。
#1
16
To expand a little on the previous answer...
在前一个答案上稍微扩展一下......
1) Create a new SVN repository
2) Commit all the code you've worked on so far to it
3) Check all that code OUT again, to create a working copy on your dev machine
4) Work!
1)创建一个新的SVN存储库2)提交你目前为止所做的所有代码3)再次检查所有代码OUT,在你的开发机器上创建一个工作副本4)工作!
It's definitely not a hurdle, really.
这绝对不是一个障碍,真的。
#2
7
I didn't see anybody addressing this part of your question/post:
我没有看到有人解决你的问题/帖子的这一部分:
Is there a tool that will automate the upload to the test, then the deployment to the live servers?
是否有一个工具可以自动上传到测试,然后部署到实时服务器?
One gotcha is that Subversion creates hidden .svn folders in your working copy. One of the solutions is to use the svn export command. That will make a copy of your repository on another directory without the .svn folders.
一个问题是Subversion在您的工作副本中创建隐藏的.svn文件夹。其中一个解决方案是使用svn export命令。这将在没有.svn文件夹的另一个目录中创建存储库的副本。
As far as I know there is no automated tool for this. You can create a batch file that will issue the svn export command like this:
据我所知,没有自动化工具。您可以创建一个批处理文件来发出svn export命令,如下所示:
svn export C:\MyReporitosy\Path C:\DestinationPath
Just include this as part of your deployment process. Make sure to deploy your code from this exported directory and not your working copy. You should be fine then.
只需将此作为部署过程的一部分。确保从此导出目录而不是工作副本部署代码。那你应该没问题。
#3
4
+1 for Matt Howell's answer.
为Matt Howell的回答+1。
I don't know how many times I've added a new project by creating the directory in the repo, Importing the new project into it, then Checking it out again. This is why Matt's answer is best:
我不知道有多少次我通过在repo中创建目录,将新项目导入其中,然后再次检出来添加新项目。这就是Matt的答案最好的原因:
-
I create a project called FRED and do some work
我创建了一个名为FRED的项目并做了一些工作
-
I create a directory in SVN repo, and import FRED into it.
我在SVN repo中创建一个目录,并将FRED导入其中。
-
But the FRED directory is still not under source control - it lacks .svn files, so I need to check it out, into a new directory, let's call it FRED-NEW, recreating all the files
但FRED目录仍然没有源代码控制 - 它缺少.svn文件,所以我需要检查它,进入一个新目录,让我们称之为FRED-NEW,重新创建所有文件
-
I then need to delete FRED, leaving me nervous something's got lost or corrupted along the way.
然后我需要删除FRED,让我感到紧张的一些东西在途中丢失或损坏。
As Matt says, check out a step earlier, while the folder in the SVN repo is still empty:
正如Matt所说,请先检查一下,而SVN仓库中的文件夹仍为空:
-
Create a directory in SVN AND CHECK IT OUT into FRED-NEW.
在SVN中创建一个目录并将其检查到FRED-NEW。
-
Copy FRED-NEW/.svn into FRED/
将FRED-NEW / .svn复制到FRED /
-
Right-click Add all the files. FRED is now under source control without recreating and deleting.
右键单击“添加所有文件”。 FRED现在处于源代码控制之下,无需重新创建和删除。
Still better:
-
Create a directory in SVN, and BEFORE adding files to it, check the empty directory out DIRECTLY INTO FRED.
在SVN中创建一个目录,在向其添加文件之前,检查空目录直接进入FRED。
-
Right-click Add all files.
右键单击“添加所有文件”。
Also if you're using CLI and didn't think of this until after committing the new files, see alroc's answer below: --force when checking out into FRED.
此外,如果您使用CLI并且在提交新文件之前没有想到这一点,请参阅下面的alroc答案: - 在结账时使用FRED。
#4
3
Import your existing base into a SVN repository, check it back out and begin working again.
将现有基础导入SVN存储库,将其检出并重新开始工作。
#5
3
You should look at Visual SVN, which integrates seamlessly into Visual Studio.
您应该查看Visual SVN,它可以无缝集成到Visual Studio中。
#6
2
Technical issues aside, just get SVN and start using it. You will see the immediate benefits (looking at code history, diff-debugging to see what change introduced the bug that was not present last week), and you will never want to look back.
除了技术问题,只需获取SVN并开始使用它。您将看到直接的好处(查看代码历史记录,差异调试以查看上周未提供的错误引入了什么更改),您永远不会想要回顾。
I, personally, do not like my source control integrated in the IDE. I use Tortoise SVN that integrates with Windows Explorer and lets you check in, diff, merge, etc files straight from the OS.
我个人不喜欢我在IDE中集成的源代码控制。我使用与Windows资源管理器集成的Tortoise SVN,让您直接从操作系统检入,差异,合并等文件。
#7
2
No SVN server required.
Use Tortoise Mercurial http://sourceforge.net/project/showfiles.php?group_id=199155
无需SVN服务器。使用Tortoise Mercurial http://sourceforge.net/project/showfiles.php?group_id=199155
Setup local repo
1) Download and Install
2) Open an explorer window to the base directory of you project
3) Right-Click -> TortoiseHG -> Create Repository Here -> Ok
4) Right-Click -> HG Commit...
5) Type your commit comment, select which files to track, and click Commit
设置本地存储1)下载并安装2)打开资源管理器窗口到项目的基本目录3)右键单击 - > TortoiseHG - >在此创建存储库 - >确定4)右键单击 - > HG提交... 5 )键入您的提交注释,选择要跟踪的文件,然后单击“提交”
Setup remote repo over file share (other transport methods available)
1) Open explorer window to remote folder
2a) Right-Click -> TortoiseHG -> Clone a Repository
2b) Alternatively, just copy your local repo over
在文件共享上设置远程仓库(可用的其他传输方法)1)打开资源管理器窗口到远程文件夹2a)右键单击 - > TortoiseHG - >克隆存储库2b)或者,只需复制本地仓库
Updating remote repo after committing local
1) Open explorer window to remote folder
2) Right-Click -> TortoiseHG -> Synchronize
3) Select "Update to new tip" in Pull menu
4) Enter the path to your local repo into the "Remote Path:" input box 5) Click Pull
提交本地后更新远程仓库1)打开资源管理器窗口到远程文件夹2)右键单击 - > TortoiseHG - >同步3)在“拉”菜单中选择“更新到新提示”4)在“远程”中输入本地仓库的路径路径:“输入框5”单击“拉”
#8
1
Subversion Server install... Subverison Client Libraries instal...
Subversion服务器安装... Subverison客户端库安装...
Install Ankh for integration with VS Install Tortoise for File Manager integration
安装Ankh以与VS Install Tortoise集成以进行文件管理器集成
In File Manager, right click on top level direction with Solution... Import...
在文件管理器中,右键单击顶层方向,解决方案...导入...
#9
1
I wondering why you had chosen Subversion? If your project is not using any vc, may be you should consider to use Mercurial or Git either.
我想知道你为什么选择了Subversion?如果您的项目没有使用任何vc,可能您应该考虑使用Mercurial或Git。
Their stronger point is that they don't need a central repository, that means that your programmers can checkout your project, go to their home, work (without having to have a connection to your servers), and the next day come back to the office and sync their repositories.
他们更强调的一点是,他们不需要*存储库,这意味着您的程序员可以检查您的项目,去他们家,工作(无需连接到您的服务器),第二天回到办公室并同步他们的存储库。
If SVN is not a mayor requirement, i recommend to consider any of both dvc systems.
如果SVN不是市长要求,我建议考虑任何一个dvc系统。
#10
0
It may be overkill for what you require but creating a SVN repository on one machine, and then on another setting up an contious integration server. TeamCity is one I would recommend. (you may also be able to use virtual PC for this if hardware is at a premium)
对于您的需求可能过度,但在一台机器上创建SVN存储库,然后在另一台机器上创建一个连续的集成服务器。 TeamCity是我推荐的。 (如果硬件非常宝贵,您也可以使用虚拟PC)
This will allow you to add the custom build steps to deploy onto the production servers once a build is complete and tested.
这将允许您在完成构建并进行测试后添加自定义构建步骤以部署到生产服务器上。
TeamCity for more information. Thi also provides a plugin into Visual Studio as well
TeamCity了解更多信息。 Thi还为Visual Studio提供了一个插件
#11
0
It is easy to start using Subversion. Download TortoiseSVN, which integrates SVN into Windows Explorer. Download AnkhSVN for VS integration. Set up svnserve as a Windows Service (it's in the docs).
使用Subversion很容易。下载TortoiseSVN,它将SVN集成到Windows资源管理器中。下载AnkhSVN for VS集成。将svnserve设置为Windows服务(它位于文档中)。
Then all you do is check out an empty directory from svn and copy all your code files into it. Then add them with Tortoise, and commit. When you change files in Visual Studio, Ankh will show you which files you've changed and you can commit them there.
然后你要做的就是从svn查看一个空目录并将所有代码文件复制到其中。然后用Tortoise添加它们,并提交。当您在Visual Studio中更改文件时,Ankh将向您显示您已更改的文件,并且您可以在那里提交它们。
We do all our deployment with NAnt scripts, although you may find batch scripts and xcopy sufficient.
我们使用NAnt脚本完成所有部署,尽管您可能会发现批处理脚本和xcopy足够。
#12
0
I'm more familiar with Perforce than subversion, but putting a project under version control is not at all hard.
我对Perforce比对subversion更熟悉,但是将项目置于版本控制之下并不困难。
Once you've installed and got your version control software running, clean out your code directory of everything that isn't a source (for instance, run 'make clean'). Then use just use the command to add new files to your repository, recursively. Follow that by a submit, and you are done. I recommend checking out onto a different machine and building at least once to make sure you have everything you need to build.
一旦安装并运行了版本控制软件,就清理掉所有非源代码的代码目录(例如,运行'make clean')。然后使用命令以递归方式将新文件添加到存储库。通过提交来完成,您就完成了。我建议您至少检查一台不同的机器并进行一次构建,以确保您拥有构建所需的一切。
As for deploying onto servers, that's not really a version control problem. You would typically either put that into your build system (i.e. 'make testinstall', 'make install') or just write shell scripts.
至于部署到服务器上,这不是真正的版本控制问题。您通常会将其放入构建系统(即'make testinstall','make install')或只编写shell脚本。
#13
0
+1 on the answers provided by Joe and Steve.. I would also mention that it is important to set up your ignore lists or SVN Props so that you don't check in user files, resharper setting.
关于乔和史蒂夫提供的答案+1。我还要提到设置忽略列表或SVN道具很重要,这样就不会检查用户文件,resharper设置。
Also make sure you include everything that may be needed for the build, such as build scripts, 3rd party assemblies, external tools such as nunit, nant etc
还要确保包含构建所需的所有内容,例如构建脚本,第三方程序集,外部工具(如nunit,nant等)
While you are at it, I would highly recommend you look at CC.net, and getting continuous integration server installed to automate your build.
当你在这里时,我强烈建议你看看CC.net,并安装持续集成服务器来自动化你的构建。
Having source control is one thing, using it properly is another entirely. Remember to check in frequently and early.
拥有源代码控制是一回事,正确使用它是另一回事。请记得经常提前入住。
#14
0
The easy answer is Subversion along with Tortoise SVN.
简单的答案是Subversion和Tortoise SVN。
I've used Subversion with visual studio, and I've implemented it with an existing project. There is a free Visual Studio plugin called Ankh, which I used with some success. However, I have had some issues where Ankh refuses to stay in sync with the real state of the files as reflected in the .svn metadata (it did things like insist a file needed to be updated when tortoise would show me it was up to date). In these instances, a visual studio restart fixed the issues, but that is painful and tedious for me.
我已经将Subversion与visual studio一起使用,并且我已经使用现有项目实现了它。有一个名为Ankh的免费Visual Studio插件,我用了一些成功。但是,我遇到了一些问题,其中Ankh拒绝与.svn元数据中反映的文件的真实状态保持同步(它确实需要更新文件,因为当乌龟会告诉我它是最新的时候需要更新)。在这些情况下,视觉工作室重新启动修复了问题,但这对我来说是痛苦和乏味的。
Currently, I stopped using Ankh and just work my project as normal in VS and then use Tortoise and windows explorer to check them in/out. This works flawlessly. No VS refreshes or restarts necessary.
目前,我停止使用Ankh并在VS中正常工作我的项目,然后使用Tortoise和Windows资源管理器来检查它们。这完美无瑕。没有VS必须刷新或重新启动。
#15
0
1) Create a new repository - you can create it on the test server and later transfer it to a dedicated server/NAS if it makes things simple for you. 2) Import all your existing source code into the repository. 3) You can create using the 'svn' command line tool (and its related tools, like svnadmin) a batch file which will automate the upload and deployment process (the latter combined with the compiler of course).
1)创建一个新的存储库 - 您可以在测试服务器上创建它,然后将其传输到专用服务器/ NAS(如果它对您来说简单)。 2)将所有现有源代码导入存储库。 3)您可以使用'svn'命令行工具(及其相关工具,如svnadmin)创建一个批处理文件,该文件将自动执行上载和部署过程(后者与编译器结合使用)。
You can find more information here: SVN book - just start read it - you don't need to read it all to start and get svn running. MSBuild - a build automation platform by microsoft, although it may be an overkill, depening on the size of your project.
你可以在这里找到更多信息:SVN书 - 只需开始阅读它 - 你不需要全部阅读以启动并运行svn。 MSBuild - 微软的构建自动化平台,虽然它可能是一种过度杀伤,取决于你的项目规模。
If you have Visual Studio on the same computer as the batch file, you may use it to compile your solution, although I'm suspecting you'll hit scaling problems in the future.
如果Visual Studio与批处理文件在同一台计算机上,您可以使用它来编译您的解决方案,尽管我怀疑您将来会遇到扩展问题。
#16
0
Version control and deployment are two separate issues (although a good version control system can make the deployment a more consistent, reproducible process). Once you have your version control server set up you can use a set of simple script/batch files to automate checking the code out and deploying it to the server.
版本控制和部署是两个独立的问题(尽管良好的版本控制系统可以使部署成为更一致,可重复的过程)。设置版本控制服务器后,可以使用一组简单的脚本/批处理文件自动检查代码并将其部署到服务器。
#17
0
To add to the previous answers, I would recommand also the obvious (but they should be made explicit) advices:
为了增加以前的答案,我还建议明显(但应该明确)建议:
- choose a stable state of your project to import in your repository (whatever tool you choose)
- create immediately a label (or tag in SVN), once the import is done and 'checked' (like 'does it compile ?', 'have we get all setting files needed ?', ...)
- think about the different 'development efforts' you will need to do during the lifecycle of this project, and that will get you a good idea of what your branches should look like.
(maintenance branch for an old version already in production while your are developing the next version, merge branch to isolate complicated merges, patch branches, ...)
选择要在您的存储库中导入的项目的稳定状态(您选择的任何工具)
一旦导入完成并“检查”(如'编译?','我们是否需要所有设置文件?',...),立即创建标签(或SVN中的标签)
想一想在这个项目的生命周期中你需要做的不同的“开发工作”,这将让你很好地了解你的分支应该是什么样子。 (正在开发下一个版本的旧版本的维护分支,合并分支以隔离复杂的合并,补丁分支,...)
Now, beware:
Is there a tool that will automate the upload to the test, then the deployment to the live servers?
是否有一个工具可以自动上传到测试,然后部署到实时服务器?
That part of your question refers to a 'release management' process, and that is very different that 'version management'.
I am not sure the version tool you will choose can help actively. Especially when you consider there should be no version control tool on a production server (in order to keep the dependency of a production server with any tool to a minimum: only monitoring and reporting tool should be allowed, in addition of course of your programm - here a web server for instance -)
您的问题的这一部分涉及“发布管理”过程,这与“版本管理”非常不同。我不确定您选择的版本工具是否可以积极帮助。特别是当您考虑生产服务器上不应该有版本控制工具时(为了将生产服务器与任何工具的依赖关系保持在最低限度:只允许监控和报告工具,除了您的程序之外 - 这里是一个Web服务器 - )
#18
0
in addition to all the other comments about the practicalities of getting the project under source control I'd encourage you to take a look at Streamed Lines: Branching Patterns for Parallel Software Development as guide to code line and branching policies - might save you some re-work later.
除了关于将项目置于源代码控制下的实用性的所有其他评论之外,我还建议你看一下流线:并行软件开发的分支模式作为代码行和分支策略的指南 - 可能会为你节省一些 - 稍后工作
Also Eric Sink had a great collection of posts introdcing the various source code control concepts - Source Control HOWTO
此外,Eric Sink收集了很多帖子,介绍了各种源代码控制概念 - Source Control HOWTO
#19
0
I have recently started to love the simplicity of Bazaar to solve the problem of starting version control after already having hacked on an application for a while.
我最近开始喜欢Bazaar的简单性来解决在已经攻击应用程序一段时间后启动版本控制的问题。
With bazaar it is really only a few simple commands: 1) bzr init 2) bzr add [the files you are interested in] 3) bzr commit
有了集市,它实际上只有几个简单的命令:1)bzr init 2)bzr add [你感兴趣的文件] 3)bzr commit
Note that this does not setup any central repository. But you can do that as well.
请注意,这不会设置任何*存储库。但你也可以这样做。
Regarding using it as a deployment tool I am quite sure I read something about it not long ago. The documentation is really good anyway.
关于使用它作为部署工具,我很确定我不久前读过它。无论如何,文档真的很棒。
#20
0
The question is clearly on Subversion (SVN is the alias).
问题显然在于Subversion(SVN是别名)。
These are the steps:
这些是步骤:
1) Create a New Repository (if needed, if using VisualSVN Server then very easy)
2) Right click on the Folder of which you want to put the folders and files into your repository
3) With having the right click menu go to TortoiseSVN
4) Choose IMPORT
5) Place in trunk (best practice)
e.g. https://computername:8443/svn/MyCoolCode/trunk
#21
-1
I use mercurial on my desktop and I love it. Creating the repository is super easy...
我在桌面上使用mercurial,我喜欢它。创建存储库非常容易......
hg init /path/to/repository
Add the files...
添加文件...
hg add /folder/pattern
OR
hg add FILE
Then you just commit...
然后你就承诺......
hg commit
And you're up and running.
而且你已经开始运转了。
The other great thing is when I want to sync to my laptop it's just...
另一件好事是,当我想要同步到我的笔记本电脑时,它只是......
hg pull //desktop_name/path/to/repo/
hg update
The thing that I like about subversion is the pluggin for Visual Studio, I stay on top of my updates more when the status icons are starring me in the face all of the time. The pluggin may definitely make up for the hassel of setting the svn repository up if you're going to be working with the one project a lot.
我喜欢颠覆的东西是Visual Studio的插件,当状态图标一直在面对我时,我会更多地关注我的更新。如果你要经常使用一个项目,插件肯定可以弥补设置svn存储库的麻烦。
#22
-1
The question was focused clearly towards an existing project. I have not yet found an appropriate answer in this thread and played around until I had the solution. The hassle comes when you checkout, as described in many answers, and you end up with a second versioned folder, your existing project remains unversioned and you are reluctant to copy/paste and/or rename your folders.
这个问题明确地针对现有项目。我还没有在这个帖子中找到一个合适的答案,并且在我有解决方案之前一直玩。结账时会遇到麻烦,如许多答案中所述,最终你得到了第二个版本化文件夹,你现有的项目仍然是无版本的,你不愿意复制/粘贴和/或重命名你的文件夹。
The solution to this problem is as follows:
该问题的解决方案如下:
Suppose you have a bunch of projects in PC1, all collected as subfolders under a folder named "Projects" and you want to version all of them in one repository. Then you would like to check it out on PC2 with the same folder structure. Then you do the following:
假设您在PC1中有一堆项目,所有项目都被收集为名为“Projects”的文件夹下的子文件夹,并且您希望在一个存储库中对所有这些项目进行版本控制。然后你想在具有相同文件夹结构的PC2上查看它。然后执行以下操作:
- Create a folder for your repository on the network drive and make sure that it is named "Projects", i.e. the same name as the parent folder of your development projects. For example create a folder like X:\Repository\Projects on a network drive.
- Right Click on this folder and choose TurtoiseSVN -> Create Repository Here
- Right Click on your development "Projects" folder on PC1 (your existing project) and press TurtoiseSVN -> Import. Choose the correct repository with the name "Projects" (in case you already have other repositories on the network drive). Now your projects are at the disposal for other PC's.
- Make a parent folder on PC2 where you want to have the "Projects" folder.
- Right Click on this Parent Folder on PC2 and choose SVN Checkout. The projects are now available on PC2.
- From now on, you use "commit" to store changes in the repository and "update" to get the latest version from the repository.
在网络驱动器上为您的存储库创建一个文件夹,并确保它名为“Projects”,即与开发项目的父文件夹同名。例如,在网络驱动器上创建类似X:\ Repository \ Projects的文件夹。
右键单击此文件夹,然后选择TurtoiseSVN - > Create Repository Here
右键单击PC1(现有项目)上的开发“Projects”文件夹,然后按TurtoiseSVN - > Import。选择名称为“Projects”的正确存储库(如果您已在网络驱动器上安装了其他存储库)。现在您的项目可供其他PC使用。
在PC2上创建一个父文件夹,您想要“Projects”文件夹。
右键单击PC2上的此父文件夹,然后选择SVN Checkout。这些项目现在可在PC2上使用。
从现在开始,您使用“commit”存储存储库中的更改并“更新”以从存储库中获取最新版本。