我不确定我打算在生产和开发服务器之间创建的 git 工作流程是否是正确的方法。
这就是我的想法:开发在本地计算机上进行,并通过 git Push
提交到开发服务器。一旦稳定版本可用,生产服务器就会从开发服务器执行git pull
。生产中的任何意外结果都可以使用 git revert
这是正确的做法吗?如果是这样,如何使现有代码位于开发服务器(远程存储库)上?据推测,当它们 pull
和推
时,它对于生产和本地都是远程的。
最佳答案
Is it the correct way of doing this?
是的,这听起来完全合理。
If so, how do I make existing code sitting on the development server, a remote repo? Presumably, it's remote to both production and local as they pull and push.
假设您通常通过 ssh 访问您的存储库,如下所示:
brian@local$ ssh brian@development
brian@development$ cd /home/brian/code
brian@development$ git status
然后您可以使用 git clone ssh://brian@development:/home/brian/code 克隆此代码。从那时起,您应该能够在开发之间进行 git Push
和 git pull
。
关于Git 生产和开发服务器工作流程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33556495/