简体   繁体   English

我们2开发人员设置上正确的git工作流程

[英]proper git workflow on our 2 dev setup

We have a repository and it only has one branch: master . 我们有一个存储库,它只有一个分支: master

My friend and I git clone on master in our local machines. 我和我的朋友在我们本地计算机的mastergit clonegit clone Whenever we have changes we git commit & git push on master and git pull for update. 每当我们进行更改时,我们会在git commitgit push mastergit pull进行更新。

Now, we bought a VPS to serve as our staging (and will be production later on) and we also setup a subdomain on our domain: 现在,我们购买了一个VPS作为暂存(稍后将投入生产) ,并且还在我们的域上设置了一个子域:

http://dev.domain.com/ => /var/www/project_dev http://dev.domain.com/ => /var/www/project_dev

http://domain.com/ => /var/www/project_prod http://domain.com/ => /var/www/project_prod

Now I am confused what should I do to have a git copy on both directories. 现在我很困惑该怎么做才能在两个目录上都有一个git副本。 Should I create a development branch and we push our local changes there and that is where /var/www/project_dev will clone? 我是否应该创建一个开发分支,然后将本地更改推/var/www/project_dev那里, /var/www/project_dev将在其中克隆? Then the master branch is where I should clone the /var/www/project_prod ? 然后master分支是我应该克隆/var/www/project_prod吗? Can you please enlighten me. 你能给我启发。

I like using this workflow . 我喜欢使用此工作流程

Git分支模型

Basically, you normally commit to develop branch. 基本上,您通常会致力于develop分支。 Merges into master indicate stable releases . 合并为master表示释放稳定 So whenever you merge into master, have a hook pulling from the master branch on the staging repo to the master branch on the production repo. 所以每当你合并到主,有一个钩子从拉动master分支上的临时回购到master在生产回购分支。

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

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