Git生产/登台服务器工作流程 [英] Git production/staging server workflow

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

问题描述

目前我的网站(生产服务器)已经有很多代码。
现在我想开始为我的项目使用Git并为我的团队设置一个临时服务器。
任何人都可以给我任何建议吗?

以下是我的想法:

<$ p $生产 - 已经有代码的生产服务器

暂存 - 新的暂存服务器,也会安装Trac
↗↙↖↘
Developer1 Developer2 - 本地开发

我的问题是,我该如何开始?



以下是我心中的一些步骤:


  1. 做一个<$ c生产服务器中的$ c> git init (这是安全的吗?)
  2. clone 到分段服务器
  3. 开发者克隆从分段到本地机器的回购

  4. 推送文件完成更改后

  5. 暂存准备就绪后, push 生产的一切

这个工作流程是否有意义,或者有更好的方法来完成它?



如果我只想更改一个文件,该怎么办?



在这个过程中,origin / master与它有什么关系?
谁是原产地?我最终会有多个来源?

另外,在这种情况下,开发人员何时应该使用分支

解决方案

最好将master分支仅用于生产和开发分支进行分段。每个开发人员都应创建本地分支以添加新功能,然后与开发分支合并。如果你还不熟悉git,请尝试使用 - http://github.com/nvie/gitflow描述git分支模型的图片也不错 - http://nvie.com / posts / a-successful-git-branching-model /

Currently my website (production server) already have a lot of code in it. And now I want to start using Git for my projects and setup a staging server for my team. Can anybody give me any advise?

Here is the picture in my mind:

        Production        - Production server which already have codes
            ↑             
         Staging          - New staging server, will install Trac too
         ↗↙ ↖↘          
  Developer1  Developer2  - Local development 

My question is, how should I start?

Here are some steps in my mind:

  1. do a git init in production server (is this safe?)
  2. clone the repo from production to staging server
  3. developers clone the repo from the staging to their local machine
  4. push files to the staging server after finish changing
  5. when staging is ready, push everything to the production

Does this work flow makes sense, or there are some better way to do it?

What if I only want to change one file?

Does origin/master has anything to do with it in this process?? Who is the origin? am I going to end up having multiple origins??

Also, when should a developer use branch in this case?

解决方案

It's better to use master branch only for Production and development branch for Staging. Each developer should create local branch to add new features and then merge with development branch. If you're new to a git, try to use - http://github.com/nvie/gitflow There is also good picture describing git branching model - http://nvie.com/posts/a-successful-git-branching-model/

这篇关于Git生产/登台服务器工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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