适合小型开发人员和设计人员团队的 Git 工作流程
我对 Git 分支模型和我想为我的团队(开发人员 + 设计师)创建的工作流程感到困惑。
假设该项目基于 MVC 模式,因此我们有类似于以下的结构:
型号/
控制器/
浏览次数/
开发人员从事并购工作具有一些基本/生成视图的 C 部件(例如 Rails、Django 或 CakePHP 应用程序) 设计师负责 V 部分
我如何管理开发人员从事 M&C 工作并保留一些基本的蹩脚视图,同时设计师根据编码的控制器操作制作性感的视图并由开发人员逐步添加?
我尝试让它与 3 个分支一起工作:
master(生产就绪)
开发
用户界面
但不知道在 ui 分支上工作的设计师如何将 /views 之外的代码保留在工作应用程序中更新...
感谢大家的帮助!
I'm getting lost with Git branching model and the workflow that I want to create for my team (developers + designers).
Suppose that the project is based on a MVC pattern, so we have a structure similar to :
Models/
Controllers/
Views/
Developers works on the M & C parts with some basic/generated views (Rails, Django or CakePHP app for example)
and Designers works on the V part
How can I manage that developers works on M&C and keep some basic crappy views, and in the same time, designers make sexy views based on controllers actions coded and added by developers progressively ?
I tried to make it works with 3 branches :
master (production-ready)
dev
ui
but no idea how a designer working on ui branch can keep the code elsewhere than /views updated an a working app...
Thanks folks for help !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 git,开发人员没有理由在单独的分支上工作或模拟视图。让设计人员和开发人员在同一分支、同一代码库中工作。当视图完成(或者至少改进并且不会崩溃)时,让设计者提交并将它们推送到主存储库。对于开发人员来说也是如此:当本地更改“完成”时,让他们提交并推送它。
在推之前,双方都需要拉(以确保不发生冲突)。如果两个组正在使用互斥的代码片段(单独的文件,甚至同一文件的不同部分),那么拉取将简单地更新本地副本,并且一切都会正常工作。
这样,双方总是可以看到最新的代码库,并直接为确切的最终目标做出贡献,观察它的发展。
With git, there's no reason for developers to work on a separate branch or to have mocked up views. Have designers and developers work in the same branch, on the same codebase. When a view is done (or at least improved and not crashing) have the designer commit and push them to a master repository. The same is true for developers: when a local change is 'done', have them commit it and push it.
Before pushing, each side needs to pull (to ensure there are no conflicts). If the two groups are working in mutually-exclusive pieces of code (separate files or even separate parts of the same files), then the pull will simply update the local copy and all will work well.
With this, both sides are always seeing the most up-to-date codebase, and contributing directly towards the exact end goal, watching it evolve.
Git 使用起来非常简单,没有理由每个人不应该拥有自己的分支来工作。天啊,这就是使用版本控制系统的主要原因之一。在 Git 中,提交很便宜。
通常,我们有一个主控,任何正在处理更新或功能的人都会从主控分支,并在需要时分支一个分支,然后发布主控(像我这样的人)将负责将它们全部合并回来,检查是否有冲突,测试版本并合并回主版本。
当您处理它时,其他人可以通过对您的分支进行提取/拉取来接收您的更改以拉取更改。
Git is so simple to use, theres no reason everyone should not have their own branch to work out of. Hell, thats one of the main reasons to use a version control system. In Git, commits are cheap.
Typically, we have a master, and anyone who is working on updates or features will branch from the master and branch a branch if need be, then a release master (someone like me) will take care of merging them all back down, checking for conflicts, testing the release and merging back to master.
As you work on it, others can receive your changes by doing a fetch/pull against your branch to pull in the changes.
Git 并不魔法。它不允许您的设计人员使用开发人员正在积极编写的代码。开发人员仍然必须编写、测试和提交他们的代码,并将其推送到开发人员可以从中提取的地方。
通常,您将拥有一个“裸”存储库,当准备好共享时,所有各方都将其工作推送到该存储库中。其他人都把这项工作推倒了。设计师的工作可能是拉动开发人员的工作并将 dev 分支合并到 ui 分支中,例如:
Git isn't magic. It doesn't let your designers use code that the developers are actively writing. The developers still have to write, test and commit their code, and push it some place the developers can pull it from.
Typically you'll have a "bare" repository that all parties push their work to when it's ready to be shared. Everybody else pulls that work down. It might be the designers job to pull the developer's work and merge the dev branch into the ui branch, for example:
如果你真的想强制执行诸如分支和路径权限之类的事情,我建议你查看 gitolite
这将允许你管理各种级别的访问。
If you really want to enforce things like branch and path rights, I suggest you checkout gitolite
This will allow you to manage access at all sorts of levels.