与2位开发人员合作 [英] Git with 2 developers

查看:97
本文介绍了与2位开发人员合作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我与另一位开发人员在同一个项目上工作,但我们每个人都有自己的工作领域(这些工作重叠但不频繁),您会如何建议我们设置git?

解决方案

最简单的工作流程。



如果你没有额外的通用环境(假设一个GitHub例如),只需为每个开发人员创建2个回购:



在这个2x2回购设置中,您只能推到您的裸回购,等待您同事拉它:





或者你可以直接推送到他的公开裸回购(针对特定补丁或对dev2任务的贡献):dev2将从他自己的公开裸回购中拉出:





在这两种情况下,和解都会发生在开发者的私人非裸回购中。


If I'm working with one other developer on the same project, but where we each have our own areas of work (which overlap, but not frequently) how would you recommend we set up git?

解决方案

The simplest workflow remains a centralized one (especially with as few developers as you have in your team)

(much) more detail in this guide.

If you don't have an extra common environment (liek a GitHub for instance), simply create 2 repo per developers:

  • one for working in it (with a working tree)
  • one bare repo (no working tree), for you or your colleague to push to.

In this 2x2 repo setup, you can only push to your bare repo, waiting for your colleague to pull from it:

Or you can push directly to his public bare repo (for specific patches or contribution to dev2 tasks): dev2 will pull from his own public bare repo:

In both cases, reconciliation will happen in the private non-bare repo of the developer.

这篇关于与2位开发人员合作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆