简体   繁体   English

一小组开发人员和设计师的Git工作流程

[英]Git workflow for a small team of developers and designers

I'm getting lost with Git branching model and the workflow that I want to create for my team (developers + designers). 我对Git分支模型和想要为我的团队(开发人员+设计人员)创建的工作流程迷失了。

Suppose that the project is based on a MVC pattern, so we have a structure similar to : 假设该项目基于MVC模式,那么我们的结构类似于:

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 开发人员使用一些基本/生成的视图(例如,Rails,Django或CakePHP应用程序)在M&C部分上工作,而设计师在V部分上工作

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 ? 如何管理开发人员在M&C上工作并保留一些基本的糟糕观点,同时,设计师根据开发人员逐渐编码和添加的控制器操作来制作性感视图?

I tried to make it works with 3 branches : 我试图使其与3个分支一起工作:

master (production-ready) 母版(可用于生产)
dev 开发者
ui ui

but no idea how a designer working on ui branch can keep the code elsewhere than /views updated an a working app... 但是不知道在ui分支上工作的设计师如何将代码保存在/ views之外的其他地方来更新正在运行的应用程序...

Thanks folks for help ! 谢谢大家的帮助!

With git, there's no reason for developers to work on a separate branch or to have mocked up views. 使用git,开发人员没有理由在单独的分支上工作或模拟视图。 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 is so simple to use, theres no reason everyone should not have their own branch to work out of. Git非常简单易用,没有理由每个人都不应该拥有自己的分支机构。 Hell, thats one of the main reasons to use a version control system. 糟糕,这就是使用版本控制系统的主要原因之一。 In Git, commits are cheap. 在Git中,提交很便宜。

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. 通常,我们有一个母版,从事更新或功能的任何人都将从母版中分支出来,并在需要时分支一个分支,然后发行母版(像我这样的人)会负责将它们全部合并,检查是否冲突,测试发行版并合并回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 isn't magic. Git不是魔术。 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: 设计人员可能会拉动开发人员的工作并将dev分支合并到ui分支中,例如:

git checkout ui
git fetch
git merge dev

If you really want to enforce things like branch and path rights, I suggest you checkout gitolite 如果您真的想强制执行分支和路径权限之类的事情,建议您检出gitolite

This will allow you to manage access at all sorts of levels. 这将使您可以管理各种级别的访问。

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

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