Git生产/登台服务器工作流程 [英] Git production/staging server workflow
问题描述
现在我想开始为我的项目使用Git并为我的团队设置一个临时服务器。
任何人都可以给我任何建议吗?
以下是我的想法:
<$ p $生产 - 已经有代码的生产服务器
↑
暂存 - 新的暂存服务器,也会安装Trac
↗↙↖↘
Developer1 Developer2 - 本地开发
我的问题是,我该如何开始?
以下是我心中的一些步骤:
- 做一个<$ c生产服务器中的$ c> git init (这是安全的吗?)
clone
到分段服务器
- 开发者
克隆
从分段到本地机器的回购
推送
文件完成更改后
- 暂存准备就绪后,
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:
- do a
git init
in production server (is this safe?) clone
the repo from production to staging server- developers
clone
the repo from the staging to their local machine push
files to the staging server after finish changing- 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屋!