简体   繁体   English

用于Web开发的Git工作流程

[英]Git workflow for web development

I have been playing around with git on my local machine and everything makes sense until it comes to a remote and multiple developers I start getting confused. 我一直在我的本地机器上玩git,一切都有意义,直到它涉及到一个远程和多个开发人员,我开始感到困惑。

My goal is to have a "semi public" dev site/s that a group of 4 people can work on and push changes to the live site as they are ready. 我的目标是建立一个“半公共”开发站点,一组4人可以工作,并在现场准备时将更改推送到现场。 We need the dev site/s to be on the public web server so that we can get approvals before pushing changes live. 我们需要将dev站点放在公共Web服务器上,以便我们可以在推送更改之前获得批准。 Security isn't a huge concern so I am planning on just using a simple .htaccess to restrict access. 安全性并不是一个大问题,所以我打算只使用一个简单的.htaccess来限制访问。 Not all of the changes need to be approved but I want the dev site/s to stay up to date. 并非所有的更改都需要获得批准,但我希望开发者网站保持最新状态。

The big challenge is that 2 of the 4 of us are designers and so the whole process of making a change and pushing it live needs to be fast and simple. 最大的挑战是我们4个人中有2个是设计师,所以改变和推动变革的整个过程需要快速而简单。 They are used to just ftping changes to the site. 它们习惯于对网站进行更改。 I don't want to make a 10 step process to do what they are doing with a keyboard shortcut right now. 我现在不想用键盘快捷键做他们正在做的10步过程。

Any suggestions? 有什么建议么?

Check out: 查看:

This should get everyone familiar with using git and give you a tool for efficiently pushing out changes. 这应该让每个人都熟悉使用git并为您提供有效推送更改的工具。

Before going further, I'll state quite clearly that git is not a web deployment tool. 在进一步讨论之前,我将非常清楚地表明git 不是一个Web部署工具。 Capistrano and friends are the superior solution, and mandatory for complex systems. Capistrano和朋友是优秀的解决方案,对复杂系统是强制性的。 However, if you have a simple enough site and don't care about atomic deployments, dependencies, forced process (ensuring all changes were QAed, etc), and the like, you can sometimes get away with a post-receive hook which does a forced git checkout. 但是,如果你有一个足够简单的站点并且不关心原子部署,依赖关系,强制进程(确保所有更改都是QAed等)等等,你有时可以使用post-receive hook来实现强迫git结账。 Then the process of deploying to a website would be to push to a special repository. 然后,部署到网站的过程将是推送到特殊存储库。 You could either have one repository for QA and one for production, or have the hook check the branch being pushed to and figure it which to update that way. 你可以有一个用于QA的存储库和一个用于生产的存储库,或者让钩子检查被推送到的分支并找出哪个更新的方式。

See http://toroid.org/ams/git-website-howto for more information on a simple post-receive hook for automatic checkout. 有关自动结帐的简单收件后挂钩的详细信息,请参见http://toroid.org/ams/git-website-howto

Of course, you can also have the post-receive hook call an actual web deployment system to take care of some of the problems mentioned above. 当然,您也可以使用post-receive hook调用实际的Web部署系统来处理上面提到的一些问题。

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

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