小团队的Git工作流程 [英] Git workflow for small web team

查看:111
本文介绍了小团队的Git工作流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这个话题已经有很多问题了,但是我很难找到我需要的东西。



我们是一个小型的开发团队,目前正在使用SVN,但很快就要切换到Git。我们习惯于检查变化并全天推送到现场网站,但目前缺乏任何正式的测试程序,这是我们想要补充的。我习惯用SVN做这件事的方式是:在个人测试环境中开发
$ b



  • 检入您的更改

  • 将当前存储库文件发送到全局(类似生产)的测试web服务器,然后测试
  • 发送当前存储库文件到现场网络服务器



这显然会造成一些问题,尤其是在通讯不好的情况下。我经历过未经测试的更改已经过的时间,这是我们一定要避免的。



我所设想的是一个主Git存储库,测试的代码正在运行在活动服务器上。然后获得用于测试修订版的存储库的克隆。我希望有一个脚本负责从请求的开发人员处提取更改,将其放入测试存储库的分支中,并运行一些自动测试以确保没有重大事件被破坏。当所有检查结果出来时,该分支可以合并并推送给主服务器并发送到实时服务器。



我想听到关于此可能性的任何评论工作流程和任何改进建议或如何以不同方式进行改进。此外,如何设置这些的任何细节也将不胜感激。谢谢!



编辑:我已经使用上述方法一段时间了,它的工作得很好。

解决方案

你真的需要一个单独的存储库吗?您的实时代码只是一个分支;您可以在测试中使用其他分支来部署候选人。

您不一定需要脚本来完成这些更改 - 开发人员可以将它们推送到单独的分支,然后调用脚本来测试该分支。


I know there are already many questions here on this topic, but I've had trouble finding exactly what I need.

We're a small team of developers currently using SVN but soon to be making a switch to Git. We are used to checking in changes and pushing to the live website throughout the day but currently lack any formal testing procedures, which is something we'd like to add. The way I'm used to doing this with SVN is:

  • develop in a personal test environment
  • check in your changes
  • send the current repository files to a global (production-like) testing webserver, and test
  • send the current repository files to the live webservers

This obviously can create some problems, especially if communication is not good. I've experienced times when untested changes have gone live and that's something we'd definitely like to avoid.

What I'm envisioning is a master Git repository that holds the tested code that is running on the live servers. Then have a clone of that repository that is used to test revisions. I'd like to have a script that is responsible for pulling changes from the requesting developer, putting them in a branch on the test repository, and running some automated tests to make sure nothing major is broken. When that all checks out, that branch can be merged and pushed up to the master and out to the live servers.

I'd like to hear any comments about this possible workflow and any suggestions for improvement or how to do it differently. Also, any specifics on how to set this up would also be appreciated. Thanks!

EDIT: I've used the above method for a while now and it's worked out pretty well.

解决方案

Do you really need a separate repository? Your live code is only a single branch; you can use other branches for "deploy candidates" under testing.

You don't necessarily need a script to pull the changes - developers could just push them to a separate branch, then invoke a script to test that branch.

这篇关于小团队的Git工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆