在一个存储库Github中添加多个项目 [英] Add multiple project in one repository Github

查看:127
本文介绍了在一个存储库Github中添加多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从Macbook的Github桌面在一个存储库中添加多个项目,但无法做到这一点。



尝试提交时显示此错误未能将文件子文件夹名称/添加到索引。



我试图找出并阅读一些答案,但不能在终端上工作。其他的我已经尝试从这里

我已将所有文件夹添加到一个文件夹的主要存储库中,然后尝试添加。



任何其他方式从Github桌面上做到这一点?



或者我错过了一些东西。有人有想法请提出建议。



预先致谢。我会很感激,如果有人给我一些更好的解决方案。

解决方案

从命令行尝试新的克隆主要回购(假设你的多个项目都是单独的git仓库):

pre $ g $ clone / url / of / main / repo
cd repo
git submodule add / url / of / project1
git submodule add / url / of / project2
git submodule add / url / of / project3
git commit - m添加多个项目
git push

它使用 git submodules 为了记录对主要项目的引用存储库。


I'm trying to add multiple project in one repository from Github desktop from Macbook but not able to do it.

While trying to commit it show me this error Failed to add file subfoldername/ to index.

I have tried to figure out and read some answers but not work from terminal as well. Other one i have tried from here.

I have added all my folder in one folder main repository then trying to add.

Is there any other way to do it from Github desktop ?

Or am i missing something. Somebody have idea please suggest something.

Thanks in advance. I'll appreciated if somebody give me some better solution.

解决方案

Try, from the command line, in a fresh clone of your main repo (assuming your multiple projects are all individual git repositories):

 git clone /url/of/main/repo
 cd repo
 git submodule add /url/of/project1
 git submodule add /url/of/project2
 git submodule add /url/of/project3
 git commit -m "Add multiple projects"
 git push

This uses git submodules in order to record references to those projects in your main repository.

这篇关于在一个存储库Github中添加多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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