0

Firstly, when it comes to git i'm a bit of a newbie.

I have two website one is used for development the other is the live site. I am just about to move all the files over to git, (and github) as I have been using SVN but think git (after a few weeks of playing) will suit the project better going forward.

What I'm trying to understand is how to get the best workflow for me, having the files uploaded onto remote servers. The sandbox version of the site currently lives locally and also uploaded to the sandbox remote site, any testing is done on here, and once we are happy we move it across to the main site Via checking in any changes flipping over to live site files and updating file then uploading.

I now intend to have the main 'Master' branch and have a 'sandbox' branch version off that. This would give me the option to create new branches for small bugs, merging them to sandbox when done and testing.

In my old way of working as the files were stored in two different places locally (had checked out two version from SVN repository) I could jump into Coda and ftp the files up to the server when ready.

I'm now guessing pushing to remote would be a better option as ftp-ing with the one repository would cause a few headaches?

I'm using Tower that is really helping my workflow, but stuck on how to get the files online. Any help or if my question doesn't make sense please shout...

4

1 回答 1

-1

我建议你在本地开发,推送到你的远程(例如 github),ssh 到你的实时服务器,然后 git 将更改从 github 拉到实时站点。

最近我一直在使用一个 3 步过程:

  • 在功能分支中本地开发。一旦准备好合并到 CI 分支。
  • 在 CI 服务器上测试。jenkins 看到 CI 分支的新提交(github post commit hook),拉下更改并在测试服务器上自动构建它并运行我所有的单元测试。
  • 如果所有测试都通过,jenkins 会构建文档并将它们提交到 docs 分支。将 CI 合并到 master 并将所有内容推送到远程服务器。github 看到这个对 master 的新提交(再次提交提交钩子)并向实时服务器发出命令以提取新更改。如果单元测试失败,它会通过电子邮件发送给我并退出。

做一些最终的现场测试并重复。

于 2013-08-02T15:52:52.947 回答