简体   繁体   English

Web开发的版本控制

[英]Version Control For Web Development

I need help with setting up version control for web development. 我需要帮助设置Web开发的版本控制。 I do it myself (with tortoise SVN) for my own files but I'm having trouble scaling my process. 我自己(用乌龟SVN)来处理自己的文件,但是在扩展过程时遇到了麻烦。 Currently we have two servers, Dev/Test and Production. 当前,我们有两台服务器,开发/测试和生产。

My personal process is as follows: 我的个人流程如下:

  1. Develop the module on test. 开发测试模块。
  2. Commit each milestone into my personal repository. 将每个里程碑提交到我的个人存储库中。
  3. Repeat until finished 重复直到完成
  4. Find each file that I modified and manually and move them to Production. 查找我手动修改的每个文件,然后将其移至生产环境。

Now my goal is to streamline the process so that we can push to prod from the repository to remove the manual updating. 现在,我的目标是简化流程,以便我们可以从存储库中推送产品以删除手动更新。

Unfortunately we use WAMP so we have licencing issues with setting up a virtual machine for each developer to work on. 不幸的是,我们使用WAMP,因此在为每个开发人员设置虚拟机时存在许可问题。 Therefore, all of us work on one server, which I believe will kill this dream. 因此,我们所有人都在一台服务器上工作,我相信它将实现这一梦想。

I keep running into the problem of uploading a bunch of crap to production. 我一直遇到将大量废话上传到生产的问题。 I'm finding it difficult to separate file that are ready from crap files to TortoiseSVN to push. 我发现很难将已准备好的文件从废话文件分离到TortoiseSVN进行推送。 I've looked up merging and exporting but they do the whole directory and do not allow me to pick which files I want. 我查找了合并和导出的内容,但是它们会处理整个目录,并且不允许我选择想要的文件。 Even if each of us had a VM with our environment how could I merge the branch without the crap that comes with the creation process. 即使我们每个人在我们的环境中都拥有一个VM,我如何也可以合并分支而不使用创建过程中没有的废话。 (Though as I type this it appears to be developer responsibility) (尽管在我键入此内容时,这似乎是开发人员的责任)

How would I create a workflow to accomplish this? 我将如何创建工作流来完成此任务?

EDIT I got it to work. 编辑我得到它的工作。

I used batch files,branches, and patches. 我使用了批处理文件,分支和补丁。 Each server has it's own branch. 每个服务器都有自己的分支。 As we develop on test, we commit all changes (even crap) to the test branch. 在进行测试时,我们会将所有更改(甚至废话)都提交给测试分支。 When a developer wants to push to prod he uses a batch file that compares the PROD branch to the TEST branch using svn diff, it then applies the patch to PROD using tortoisemerge. 当开发人员想要推送到产品时,他使用一个批处理文件,该文件使用svn diff将PROD分支与TEST分支进行比较,然后使用tortoisemerge将补丁应用于PROD。 This is important because it allows the developer to choose which files to patch. 这很重要,因为它允许开发人员选择要修补的文件。 Finally it commits the changes to prod with TortoiseProc.exe and the developer can comment on the changes. 最后,它使用TortoiseProc.exe将更改提交到产品,并且开发人员可以对更改进行评论。 We update TEST from PROD using the same process but in reverse. 我们使用相同的过程从PROD更新测试,但过程相反。

  1. For multi-repository development SVN is, well, Bad Choice, migration to DVCS ( don't use Git) will make life somehow easier, but it's offtopic here, in this question, due to the most of tags 对于多存储库开发,SVN是错误的选择,向DVCS( 不使用 Git)的迁移将使生活变得更轻松,但是由于标签最多,在本问题中这是脱口而出的。

Anyway, you can try start with SVN, and this solution (dirty draft, collisions is your headache) may be even scalable to the few developers (you'll get not technical, but organizational problems with mid- or large-size SVN-team) 无论如何,您都可以尝试从SVN开始,并且该解决方案(肮脏的草稿,冲突是您的头疼)甚至可以扩展到少数开发人员(您可能不会遇到技术问题,但会遇到中大型SVN团队遇到的组织问题) )

  1. Create on TEST|PROD|every DEVEL the same repositories, which will share the same UUID ( mandatory!!! ) - ask your SVN-admin, how to achieve it 在TEST | PROD |每个设备上创建相同的存储库,这些存储库将共享相同的UUID (必选!! )-问问SVN管理员,如何实现它
  2. Post-commit hooks on TEST|PROD must update local WCs of each environment after commit to repo 提交回购后,TEST | PROD上的提交后挂钩必须更新每个环境的本地WC
  3. Checkout from TEST, develop, commit and test on TEST 从TEST检出,在TEST上进行开发,提交和测试
  4. On reached stable-point relocate you WC to PROD repository and commit (modified) Working Copy as one squashed giant commit, which will contain all changes made to TEST after previous commit to PROD 在达到稳定点后,将WC重新定位到PROD存储库并提交(修改)工作副本作为一个压缩的巨型提交,其中将包含先前提交到PROD之后对TEST所做的所有更改
  5. Relocate back to TEST 重新回到测试

For multi-developers work you'll have to have personal branches for each developer, cross-branch syncing|mering before commit to PROD, maybe something forgotten 对于多开发人员的工作,您必须为每个开发人员都有自己的分支机构,在提交PROD之前进行跨分支同步, 也许有些遗忘了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM