简体   繁体   English

为整个项目添加一个仓库(frontend + node.js)

[英]Git one repo for the whole project (frontend + node.js)

Let say I have a project the consists of following parts: 假设我有一个项目,包括以下部分:

  1. Front-end App (JavaScript) 前端应用(JavaScript)
  2. Back-end App (Node.js) 后端应用程式(Node.js)

Is it sensible to have one folder for the front-end app and node.js backend app? 为前端应用程序和node.js后端应用程序拥有一个文件夹是否明智? Or in what case it is reasonable to separate it into different repos? 还是在哪种情况下将其分成不同的存储库是合理的?

Is the backend intrinsically tied to the front end, could you conceivably disconnect the back end and use it for another application? 后端在本质上与前端相关联吗?可以想象,您可以断开后端并将其用于其他应用程序吗? If you can use it with another application then it should be separate repositories, but if it cannot, then it would be better to keep it as two folders in the same repository. 如果可以将其与另一个应用程序一起使用,则它应该是单独的存储库,但是如果不能,则最好将其作为两个文件夹保存在同一存储库中。

I would use a main repo with two git submodules. 我将使用具有两个git子模块的主仓库。 One submodule for the front-end, and another for the back end. 一个子模块用于前端,另一个子模块用于后端。

Whenever there is release of compatible versions of both front-end and backend, you can update update the references on the main module and commit. 每当有前端和后端的兼容版本发布时,您都可以更新更新主模块上的引用并提交。

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

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