混帐:如何管理使用Git一个网站吗?如何使用Git的一个网站-deployment? [英] Git: How to manage a website with Git? How to use Git for a website -deployment?

查看:179
本文介绍了混帐:如何管理使用Git一个网站吗?如何使用Git的一个网站-deployment?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本来,我以为我的问题是如何保持分支机构Apache的DocumentRoots?,但实现了正确的问题实际上是如何使用Git的部署东西网 - 服务器,如Apache?

我觉得我现在已经明白DocumentRoot的 - 问题,它需要Apache的黑客,我想避免因为使用副作用更简单的解决方案,并把部署-dir外的回购,但现在明白一个问题混帐取-hook以及如何在外面的事情是一个大的目录,或许只是CP之外再部署MV东西 - 但必须有同步部署-dir,想一些更好的办法


  

的DocumentRoot - 问题


  
  

    

DocumentRoots指定在httpd.conf显示目录的主存的​​材料。
    现在,这样的文件夹中,我想ticgit -branches和功能-branches。
    当我在一些DocumentRoot的创建分支,我得到主人和
    另一支混合起来。 $ git的结帐--orphan功能<0.01 / code>不是
    空的,但包含主-things。 $ TI新... 创建一个分支
    有东西从主机,在Ticgit apparrently一些bug(它的工作原理
    小回购,但对于像较大的回购创造ticgit -branch我
    DocumentRoot的成果转化为破坏)。那么,你如何保持在Apache中的DocumentRoot您设有分公司?你有你的票呢?
    那你的功能-branches?你看我这个疑惑, $混帐
    结帐功能0.1
现在如何阿帕奇知道哪些文件它
    应承载?在主事物或事物功能0.1


  
  
  

我更新的DocumentRoot的理解 - 问题


  
  

    

现在与后者的问题是,在部署不意味着
    像这样工作。我知道SethRobertson指南指示一些方法
    使用git进行部署。我认为他们是最好的方法,到目前为止,
    而不是使用G​​it -repo黑客在Apache部署内部
    -dir(通常WWW)。


  

解决方案

  

错了!


不要部署-dir(Apache中常见的WWW)的内部发展。在其他地方开发和使用SethRobertson指南概述这里副作用和适当的版本控制好规则,特别是关于1.0版本的部署分支和标记规则让你保持一个时间表事态如何发展一段时间。他指出一个做不是为活动乱开发和部署之下,恐怕不是一件好事为您的用户也(他们可能不希望看到你在浏览网站的编辑)。

SethRobertson指南指明了DO-不是搞乱了部署和发展


  

使用混帐作为Web部署工具


  
  

是的,它可以在一个简单的充分/非关键的环境中完成
  与用git喜欢的东西作者Abhijit梅农先生的文件
  管理一个网站,以帮助,但也有其他的例子。然而,
  这不给你原子更新,同步数据库更新,或
  工业部署系统的其他饰物。


所以使用Git来管理一个网站 -tutorial的此处,例如这里和的这里 - 但请注意他的警告,然而,这并没有给你原子更新,同步DB -

Originally, I thought my problem was How to maintain branches in Apache's DocumentRoots? but realized the right question actually is How to use Git to deploy stuff to web -server such as Apache?.

I feel I have understood now the DocumentRoot -problem, it would require Apache hacking that I want to avoid because much simpler solution using side-effects and putting the repo outside the deployment -dir but now a problem to understand git-fetch-hook and how to deploy stuff if the outside thing is a large dir, perhaps just cp besides and then mv -- but there must be some better way of syncing the deployment -dir, thinking.

DocumentRoot -problem

DocumentRoots specify the dirs in httpd.conf for hostable material. Now in such folder, I want ticgit -branches and feature -branches. When I create branches in some DocumentRoot, I get master and the other branch mixed up. $ git checkout --orphan feature-0.01 is not empty but contains master -things. $ ti new ... creates a branch that has stuff from master, apparrently some bug in Ticgit (it works in small repos but creating ticgit -branch for larger repos like my DocumentRoot results into havoc). So how do you maintain your braches in Apache's DocumentRoot? Do you have your tickets there? What about your feature -branches? Look I am puzzled by this, $ git checkout feature-0.1 and now how does apache knows which files it should host? Things in master or things in feature-0.1?

My updated understanding of the DocumentRoot -problem

Now the problem with latter is that the deployment is not meant to work like this. I know SethRobertson's guide instructs some ways to use git for deployment. I think they are the best methods so far instead of hacking the Apache with git -repo inside the deployment -dir (commonly www).

解决方案

WRONG!

Do not develop inside your deployment -dir (commonly www in Apache). Develop elsewhere and use side-effects and proper version-control good-rules outlined in SethRobertson's guide here, particularly the rule about deployment branch for version 1.0 and tagging so you maintain a timeline how things develop over time. He states a do-not for the activity to mess development and deployment below, probably not good thing for your users also (they probably not wanting to see your editing of the website while browsing).

SethRobertson's guide states a DO-NOT for messing up deployment and development

use git as a web deployment tool

Yes it can be done in a sufficiently simple/non-critical environment with something like Abhijit Menon-Sen's document on using git to manage a web site to help, though there are other examples. However, this does not give you atomic updates, synchronized db updates, or other accouterments of an industrial deployment system.

So Using Git to manage a web site -tutorial here, example here and here -- but notice his warning "however, this does not give you atomic updates, synchronized db--".

这篇关于混帐:如何管理使用Git一个网站吗?如何使用Git的一个网站-deployment?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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