使用git bash创建git子模块时,出现以下错误
$ git submodule add https://github.com/******/my-repo/my-app
Cloning into 'D:/my-repo/my-app'...
remote: Not Found
fatal: repository 'https://github.com/*******/my-repo/my-app/' not found
fatal: clone of 'https://github.com/*******/my-repo/my-app' into submodule path 'D:/my-repo/my-app' failed
以下是我的.git / config文件
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = https://github.com/*******/my-repo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
我能够从github克隆my-repo,但是在克隆后尝试添加子模块时,我看到此错误。我是否应该在github中为my-app子模块单独创建一个存储库,以便能够将其添加为另一个存储库(my-repo)中的子模块?
或者,我在这里缺少任何配置吗?
PS:我正在关注此链接-https: //git-scm.com/book/en/v2/Git-Tools-Submodules
我是否应该在github中为my-app子模块单独创建一个存储库,以便能够将其添加为另一个存储库(my-repo)中的子模块
是。
https://github.com/******/my-repo/my-app
不是要克隆的Git存储库的URL。
它是现有存储库的子文件夹的URL(即:)https://github.com/*******/my-repo.git
。
拥有myapp
自己的存储库是能够将其作为子模块添加到另一个存储库的先决条件。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句