gpt4 book ai didi

git - 空字符串不是有效的路径规范

转载 作者:太空狗 更新时间:2023-10-29 14:41:38 29 4
gpt4 key购买 nike

看完Git - git-submodule Documentation ,我决定将我之前项目的两个文件导入到我新项目的根目录下,因为我不想手动同步这两个文件。但是,当我执行以下命令时出现错误:

$ git submodule add -b master -f --name latexci -- https://github.com/donizyo/LaTeX-Travis.git .
fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths
usage: git submodule--helper clone [--prefix=<path>] [--quiet] [--reference <repository>] [--name <name>] [--depth <depth>] --url <url> --path <path>

--prefix <path> alternative anchor for relative paths
--path <path> where the new submodule will be cloned to
--name <string> name of the new submodule
--url <string> url where to clone the submodule from
--reference <repo> reference repository
--dissociate use --reference only while cloning
--depth <string> depth for shallow clones
-q, --quiet Suppress output for cloning a submodule
--progress force cloning progress

我正在使用 Git Bash 2.19.1.windows.1 来执行 git 命令。

最佳答案

路径 (.) 应该是一个不存在的文件夹,例如 Latex-Travis

相反,此处“.”被解释为空路径(因为它引用了您的父存储库),如 ruby-git/ruby-git issue 345 中所示:

This really was deprecated since Git 2.1.6:

An empty string as a pathspec element that means "everything" i.e. 'git add ""', is now illegal. We started this by first deprecating and warning a pathspec that has such an element in 2.11 (Nov 2016).

我不知道在父仓库文件夹中直接添加了子模块:我总是习惯于添加为父仓库子文件夹

关于git - 空字符串不是有效的路径规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53440570/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com