TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: What's your dev teams git multi-environment setup workflow like?

22 点作者 jqueryin超过 14 年前
I've been scouring the web for different git workflows to find one that would work for my development team. I'm looking to add development, staging, and production remotes.<p>I'd like to hear about your workflows entailing multiple environments, as I haven't locked down on any one particular solution. If you have any links, those would be appreciated as well. Thanks!

7 条评论

slashbunny超过 14 年前
We are using 3 remotes with Git on a team with 5 people. Here's how we do it:<p>* "dev" branch: This branch holds all development code and code being tested on our development site<p>* "master" branch: After code has been fully developed and tested, it's moved into the master branch. This code sits on our staging site.<p>* tags: We tag commits on the master branch, which represents a production release. We tag releases using the format YYYYMMDD.##, so if there was a release today, it'd be 20100929.01. If there was another, the ending number would increment.<p>All development is branched off of master to start in a feature branch. Once it's ready for testing, it's merged to dev. When it's considered ready for release, the topic branch is merged into master. After final testing, master is tagged and the feature is released into production. We use a shared central repository on the network, rather than trying to manage branches between one another.<p>One consideration you might want to think about is "dead" code in your development branch. We have had instances where, for whatever reason, code was developed in a topic branch, merged into "dev", then development stopped. It could have been changing priorities, changing requirements, "oh never mind, we don't want that", or whatever. To combat the issue of "dev" having a bunch of junk (which confounds testing), we "refresh" it monthly. An automated process on our continuous integration server simply deletes the "dev" branch and re-creates it off of "master". Then, an email is sent to developers telling them to do the same thing and to merge their topic branches back into "dev". Of course, this means that "master" and the topic branches must have all our code, no development must be done in "dev" directly.<p>To automate all this, our continuous integration system (Hudson) monitors the "dev" and "master" branches. If there is a change, it runs some basic checks (lint, unit testing, etc), then rsync's the code to the appropriate web server automatically. For production releases, it's (intentionally) a more manual process. Tagging must be done manually and a programmer must go into the CI server to kick off the production release by specifying the tag to release. If we need to roll back to the previous release, the process is the same.<p>I think having a central repository and a system automate deployment to the remotes is essential and probably more important than your particular git branching scheme. It's made our lives much easier and has caught countless problems (and spammed us via XMPP) that we might not have noticed if programmers were just "git push"ing to the web servers.
bnoordhuis超过 14 年前
In a nutshell:<p><pre><code> 1. All developers push to the remote master 2. Acceptance testing is done against the master 3. Once accepted, the release is tagged 4. The release is exported to production with `git archive` or `git checkout-index -a` </code></pre> For larger teams you might need fine-grained control, but it works great for our small team.
评论 #1738994 未加载
ryanwaggoner超过 14 年前
We use this:<p><a href="http://nvie.com/posts/a-successful-git-branching-model/" rel="nofollow">http://nvie.com/posts/a-successful-git-branching-model/</a>
评论 #1739250 未加载
评论 #1739160 未加载
评论 #1739152 未加载
jjanyan超过 14 年前
Concurrent development with maximum flexibility:<p>It might be a bit hard to follow, but this is the branching strategy we follow. <a href="http://tinypic.com/view.php?pic=15wi351&#38;s=7" rel="nofollow">http://tinypic.com/view.php?pic=15wi351&#38;s=7</a><p>We use jira for managing our code changes and requests. Each ticket has its own branch. Everyday we merge the tickets we want to go out into a release branch, as you can see in the image. Release, then merge into master once we are satisfied with the release.<p>The benefits of this strategy is having maximum flexibility in releasing any code change. A request can be made, completed, and released in the same day, often in combination with changes that have been in progress for weeks.<p>The draw back is managing which branches are going out when, more so with teams greater than 20. It takes knowledgeable team leads and release managers.
agotterer超过 14 年前
This isn't exactly what you are looking for. But this is what we use to handle our tagging and deployment to staging/production. <a href="http://github.com/apinstein/git-deployment" rel="nofollow">http://github.com/apinstein/git-deployment</a>. It's a capistrano multi environment recipe that automates a lot of the tasks.
Mamady超过 14 年前
I understand that git is the new hip version control, but if everyone uses it with a 'master' branch... why bother? Why not just use subversion? It defeats the whole purpose of using a distributed version control system.
评论 #1740239 未加载
zackola超过 14 年前
This is how we do it. <a href="http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html" rel="nofollow">http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-te...</a>