Git存储库设置为具有服务器和客户端的项目 [英] Git repository setup for a project that has a server and client

查看:192
本文介绍了Git存储库设置为具有服务器和客户端的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个正在启动的项目的一部分,它将有一个客户端可执行文件和一个服务器可执行文件。我们使用git来帮助我们的团队更新代码,这是我们第一次使用git(这个项目是一个类)。我开始设置我的项目使用的git存储库,但我不知道什么是最好的设计,有客户端和服务器代码。



,如何设置存储库?除了网络之外,两者之间不会有很多代码共享。然而,我们看到两者之间的网络是最重要的方面,并希望保持两者使用相同的网络概念。我对顶部做了一些研究,我看到了可能性,两个单独的存储库,我们必须确保两个代码彼此兼容,或者我们使用单个存储库?



对不起,对于这个相当新的方法,我已经阅读Git Pro,但没有太多的经验,使用git项目工作与多个人。

解决方案

如果客户端和服务器是相互独立的,他们是在自己的git repo中的好候选。这是 组件方法



您可以有三个仓库:




  • 客户




  • //git-scm.com/book/en/Git-Tools-Submodulesrel =nofollow> submobules 在Git中是整洁的记录准确的SHA1你一起为您的系统使用。

    因此,您可以定义2个父级回购:




    • 客户端应用




      • 客户

      • 网络


    • app




      • 服务器

      • 网络

      li>


    这个想法是能够说明客户端和服务器是否使用相同或不同版本的网络。



    所有的设置可能是一个类项目的过度,但可以说明系统方法(一个巨大的repo中的一切)和组件方法之间的区别。



    在不同的git repo中分离允许独立的标记和分支。


    I am part of a project that is starting up that will have a client executable and a server executable. We are using git to help keep our team updated with code and this is the first time for many of us using git (This project is for a class). I am starting to setup the git repository for my project to use but I am not sure what would be the best design for having client and server code.

    So onto the question, how should the repository be setup? There will not be a lot of code sharing between the two except for networking. However we are seeing the networking between the two as the most important aspect and want to keep both using the same networking concepts. I've done some research into the top and I see possibilities, two separate repositories where we will have to ensure both codes are compatible with each other, or do we use a single repository?

    I'm sorry for the fairly new approach for this, I've read "Git Pro" but haven't had too much experience yet with using git for project working with multiple people.

    解决方案

    If the clients and servers are fairly independent one from another, they are good candidate for being in their own git repo. This is the component approach.

    You could have three repos:

    • client
    • server
    • networking (common modules)

    The submobules in Git are neat to record the exact SHA1 you are using together for your system.
    So you could define 2 parents repo:

    • client app

      • client
      • networking
    • server app

      • server
      • networking

    The idea being to be able to say if the client and the server are using the same or a different version of the networking.

    The all setup might be an overkill for a class project, but could illustrate the difference between the system approach (everything in one giant repo), and the component approach.

    Separating in different git repo allows for independent tagging and branching.

    这篇关于Git存储库设置为具有服务器和客户端的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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