无法在子模块路径中找到当前 origin/master 修订版
Unable to find current origin/master revision in submodule path
在我的项目中(使用git
),我需要使用a library,目前还在进行中。我决定为该库创建一个子模块,因为我想不时更新它的最新版本(我不打算在那里进行自己的更改)。
我做到了:
git submodule add https://github.com/mb21/JSONedit.git
git commit -am 'added JSNedit submodule'
git push -u origin master
git pull origin master
然后,我确实在我的本地文件夹中看到了 JSONedit 文件夹,在我的 git 文件夹中看到了一个 link 在线文件夹。但是当我执行 git submodule update --remote JSONedit/
时,出现以下错误:
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path 'JSONedit'
有人知道这里出了什么问题吗?
运行 主存储库中的这个应该可以解决问题:
git pull --recurse-submodules
根据其他讨论,尤其是 @Tobu pointed out in his comment over there,如果错误仍然存在,可能需要先:
remove both the submodule worktree (ext/blah) and the matching folder inside the GIT_DIR (.git/modules/ext/blah
)
或者,您可以 git checkout
在子模块内部要从中拉出的分支,然后 运行 git pull
.
结果应该是一样的。
看来这个问题已经在这个帖子中解决了:
Git submodules - pulling into a new clone of the super project。
简而言之,您应该尝试:
# rm -rf JSONedit
# git submodule update
我遇到了同样的问题。它得到了解决。存储子模块的文件夹就在那里。当我手动删除文件夹时,它已经解决了。
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path
- 我遇到这样的问题...
- 我通过更新 git 版本解决了这个问题
在我的例子中,问题是 Git 子模块假设会有一个分支 origin/master .相反,子模块存储库只有一个分支 main.
我在 .gitmodules
中的子模块定义中添加了 branch=main
。在 运行 git submodule sync
之后,git submodule update --remote
现在可以正常工作了。
在我的项目中(使用git
),我需要使用a library,目前还在进行中。我决定为该库创建一个子模块,因为我想不时更新它的最新版本(我不打算在那里进行自己的更改)。
我做到了:
git submodule add https://github.com/mb21/JSONedit.git
git commit -am 'added JSNedit submodule'
git push -u origin master
git pull origin master
然后,我确实在我的本地文件夹中看到了 JSONedit 文件夹,在我的 git 文件夹中看到了一个 link 在线文件夹。但是当我执行 git submodule update --remote JSONedit/
时,出现以下错误:
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path 'JSONedit'
有人知道这里出了什么问题吗?
运行 主存储库中的这个应该可以解决问题:
git pull --recurse-submodules
根据其他讨论,尤其是 @Tobu pointed out in his comment over there,如果错误仍然存在,可能需要先:
remove both the submodule worktree (ext/blah) and the matching folder inside the GIT_DIR (
.git/modules/ext/blah
)
或者,您可以 git checkout
在子模块内部要从中拉出的分支,然后 运行 git pull
.
结果应该是一样的。
看来这个问题已经在这个帖子中解决了: Git submodules - pulling into a new clone of the super project。 简而言之,您应该尝试:
# rm -rf JSONedit
# git submodule update
我遇到了同样的问题。它得到了解决。存储子模块的文件夹就在那里。当我手动删除文件夹时,它已经解决了。
fatal: Needed a single revision
Unable to find current origin/master revision in submodule path
- 我遇到这样的问题...
- 我通过更新 git 版本解决了这个问题
在我的例子中,问题是 Git 子模块假设会有一个分支 origin/master .相反,子模块存储库只有一个分支 main.
我在 .gitmodules
中的子模块定义中添加了 branch=main
。在 运行 git submodule sync
之后,git submodule update --remote
现在可以正常工作了。