简体   繁体   English

大型php / mysql Web应用程序的版本控制

[英]Version control for large php/mysql web application

I am working on a large php/mysql application, and I am getting to the point that i have to use some kind of version control. 我正在研究一个大型的php / mysql应用程序,我正在谈到我必须使用某种版本控制。 I have read a few articles on GIT, but i can't seen to figure out what the best way is to go about this. 我已经阅读了一些关于GIT的文章,但我无法弄清楚最好的方法是什么。

I have a dedicated server that runs CENTOS with PLESK. 我有一个专用的服务器,用PLESK运行CENTOS。 And i mainly develop on my local machine that on which u use XAMPP. 我主要在我使用XAMPP的本地机器上开发。

If i want to use version control should i install this on the server that uses PLESK, or should i install this on my local machine. 如果我想使用版本控制,我应该在使用PLESK的服务器上安装它,或者我应该在我的本地机器上安装它。 And will this also record the database changes i made. 这也将记录我所做的数据库更改。

Another thing i question is the use of the github. 我质疑的另一件事是使用github。 Should I still upload the changes to the hub, or do i need to make my own place on the server where the source files are stored. 我是否仍应将更改上传到集线器,或者我是否需要在存储源文件的服务器上自己放置。

Thank you for your time! 感谢您的时间!

The normal procedure would be to develop your software using version control. 正常的程序是使用版本控制开发您的软件。 When you have a release that needs to go to the test or live server you would deploy the code from the repository to the test/live server. 如果您有需要转到测试或实时服务器的版本,则可以将代码从存储库部署到测试/实时服务器。 If you are using GIT then it only needs to be on your machine as this is how GIT is designed, as a distributed version control system. 如果您正在使用GIT,那么它只需要在您的机器上,因为这就是GIT的设计方式,作为分布式版本控制系统。 If you were using Subversion then that may well reside on a server away from your machine. 如果您使用的是Subversion,那么它很可能位于远离您的计算机的服务器上。 However in this instance you would still deploy in the same way. 但是,在这种情况下,您仍将以相同的方式部署。

It is not normal to add the database changes to version control for various reasons (there is discussion of that in other question here on SO) 由于各种原因将数据库更改添加到版本控制是不正常的(在SO上有关于其他问题的讨论)

You only need to use GitHub if you are working with other people or are opening your code up to the wide world to download and uses. 如果您正在与其他人合作,或者正在向广泛的世界打开您的代码以下载和使用,您只需要使用GitHub。 However another reason for uploading to GitHub would be in case your local machine with all the code and the repository crashed and you lost the local copies you could recover from there. 然而,上传到GitHub的另一个原因是,如果您的本地计算机上的所有代码和存储库崩溃,您丢失了可以从那里恢复的本地副本。 However i assume you are making backups? 但是我假设你正在备份?

Edit - addition There is a free book which deals with git but to deal with below you add a file called gitignore and in it you add the file patterns that you do not want in the repository. 编辑 - 添加有一本免费的书来处理git但是为了处理下面你添加一个名为gitignore的文件,你在其中添加了你不想要的文件模式。 so you have local config file and remote config files on the target server but they do mnot get overwritten as your local files are not in the repository 所以你在目标服务器上有本地配置文件和远程配置文件,但它们不会被覆盖,因为你的本地文件不在存储库中

You don't need version control on your deployment machine, it's sufficient to have an SVN Repository which you connect to using your development machine. 您不需要在部署计算机上进行版本控制,只需使用您的开发计算机连接到SVN存储库就足够了。 And when the current build / release is ready for production you simply upload it / deploy it. 当当前的构建/发布准备好生产时,您只需上传/部署它。

There is no need for an SVN client on your production server. 生产服务器上不需要SVN客户端。

You might also want to read this article about Using SVN for Web Development . 您可能还想阅读有关使用SVN进行Web开发的文章

I agree with other answers but If you like to use git and to have a fast test deployment method on your remote machine (useful for testing purposes) you could give a try to Gitosis . 我同意其他答案,但如果您想使用git并在远程计算机上使用快速测试部署方法(对于测试目的很有用),您可以试试Gitosis It's a simple git server solution, simply put you can have your own "git server" on your remote machine, useful to keep a remote backup copy of your work. 这是一个简单的git服务器解决方案,只需要在远程计算机上拥有自己的“git服务器”,这对于保留工作的远程备份副本非常有用。

Than you can commit your changes locally or push them back to the remote machine. 您可以在本地提交更改或将其推送回远程计算机。

On the remote machine you'll have to clone the repository also in the directory you're going to use for your project... 在远程计算机上,您还必须在要用于项目的目录中克隆存储库...

It's easier than it seems and it work really good :) 它看起来比它看起来更容易,而且效果非常好:)

With git, you don't need a server. 使用git,您不需要服务器。 Any folder where git is used, ie git --init is run, becomes a git repository and stores all version information in .git , a subfolder of that directory. 使用git的任何文件夹,即运行git --init ,都会成为git存储库,并将所有版本信息存储在.git (该目录的子文件夹)中。

Github is used for collaboration between open source projects - hosting a bare copy of the repository in a central place - a bare copy is just the .git folder without a working tree. Github用于开源项目之间的协作 - 在中央位置托管存储库的裸副本 - 裸副本只是没有工作树的.git文件夹。

As for whether it can handle mysql database contents; 至于它是否可以处理mysql数据库内容; git can track binary files, but mysql typically stores its data separate from your application's source folders, so that might be hard to do. git可以跟踪二进制文件,但是mysql通常将其数据与应用程序的源文件夹分开存储,因此可能很难做到。

As Filip says, you don't need VCS on your deployment machine; 正如Filip所说,您的部署机器上不需要VCS; that said, with git, you could just push up your commits. 那说,用git,你可以提升你的提交。

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

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