简体   繁体   English

添加新的远程存储库<url>对于您的存储库</url>

[英]Add a new remote repository <URL> for your repository

I want to add a new remote repository (public folders) to my repository.我想向我的存储库添加一个新的远程存储库(公共文件夹)。 Here are my steps in linux terminal:这是我在 linux 终端中的步骤:

  1. $ git clone https: "MY OWN REPOSITORY" $ git 克隆 https:“我自己的存储库”
  2. $ cd folder $ cd 文件夹
  3. folder$ git clone https: "EXTERNAL PUBLIC REPOSITORY"文件夹$ git 克隆 https:“外部公共存储库”
  4. folder$ git init文件夹$ git init
  5. folder$ git add --all文件夹$ git 添加 --all
  6. folder$ git commit -m 'First commit'文件夹$ git commit -m '第一次提交'
  7. folder$ git remote add externalfolder https "EXTERNAL PUBLIC" REPOSITORY文件夹$ git 远程添加外部文件夹 https“外部公共”存储库
  8. folder$ git remote -v文件夹$ git 远程-v
  9. folder$ git push origin master文件夹$ git 推送源主

What I'm doing incorrect since I can't open the remoted folder in my own repository in github?我做错了什么,因为我无法在 github 的自己的存储库中打开远程文件夹?

Thanks in advance!提前致谢!

Looks like you want to add a separate repository inside your own repo.看起来您想在自己的存储库中添加一个单独的存储库。

this concept is called as submodule .这个概念被称为子模块 you can add your external project as submodule您可以将外部项目添加为子模块
git submodule add "EXTERNALPROJECTURL" "folder_path_where_you_want_to_clone"

for more example and tutorials on submodule, you can refer to this link有关子模块的更多示例和教程,您可以参考此链接

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

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