git &独立开发者的开发设置
我希望得到一些指导来改进我的开发工作流程。我是一名独立开发人员,目前在专用 Centos 服务器上运行多个站点,到目前为止,我只是在我的计算机上进行本地开发并使用 FTP 上传到服务器。我想通过引入 Git 进行版本控制并通过从本地到暂存再到生产的暂存过程来改进此设置。
我已经在生产服务器上安装了 Git,并开始为每个实时站点创建存储库(.git 与实时项目位于同一目录中)。我仍然需要学习如何正确使用 Git,但是这种类型的设置是否明智?
就每个项目都有一个暂存站点而言,我正在考虑从每个活动站点的子域开始,仍然驻留在同一服务器上。
从基本层面来看,这种类型的设置有意义吗?感谢您的指点!
I'm hoping for some pointers to improve my development workflow. I'm a solo developer currently running a number of sites on a dedicated Centos server and up until now I've just been developing locally on my machine and uploading to the server using FTP. I want to improve this setup by introducing Git for version control and by having a staging process, from local to staging to production.
I've installed Git on my production server and I've started creating repositories for each of my live sites (with .git inside the same directory as the live project). I still need to learn how to use Git properly, but is it advisable to have this type of setup?
In terms of having a staging site for each project, I am thinking of just starting with subdomains for each live site, still residing on the same server.
At a basic level, does this type of setup make sense? Thanks for any pointers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我在个人项目中使用的方法,对于极少数非常小的网站来说,它对我很有帮助。我通常会得到一个小的 shell 脚本,它可以提取更改、调整权限、运行任何挂起的迁移等。只需确保您的 .git 目录存在于可公开访问的 Web 根目录之外(对于从头开始的 PHP 站点来说,这可能是一个问题) ,对于 Rails 或大多数 PHP 框架来说则不然)。
然而,在工作中,我们有许多大型网站,手动拉取更改、运行迁移、调整权限等变得相当乏味。我们使用一个名为 Capistrano,它将自动执行上述步骤(以及更多步骤)。甚至还有一个极其用户友好的基于网络的前端,Webistrano。
This is the approach I use for my personal projects, and it's served me well for a very small number of very small sites. I generally wind up with a small shell script that pulls changes, adjusts permissions, runs any pending migrations, etc. Just make sure that your .git directory exists outside of the publicly-accessible web root (potentially a problem for from-scratch PHP sites, not so much with Rails or most PHP frameworks).
At work however, where we have many large sites, it becomes pretty tedious to manually pull changes, run migrations, adjust permissions, etc. We use a system called Capistrano, which will do the above steps (and many more) automatically. There is even an extremely user-friendly web-based front end, Webistrano.
除了开发周期之外,人们还使用 Git 进行部署
请参阅此问题寻求一些指导。这个想法基本上是在生产/登台服务器上安装 git,并使用一些脚本自动从特定分支获取更改并将它们复制到您的 Web 服务器。
Apart from the development cycle, people have been using Git for deployment as well
See this question for some pointers. The idea basically is to have a git installation on the production/staging server as well and have some scripts to automatically fetch changes from a specific branch and copy them over to your web server.