Git 하위 모듈. 슈퍼 프로젝트의 새 복제본 가져 오기
확인. 그래서 나는 이것을 핥았다고 생각했지만 ... 이제 ....
GitHub의 작은 라이브러리 하나를 하위 모듈로 포함하는 프로젝트가 있습니다. 해당 수퍼 프로젝트의 원래 버전에서 하위 모듈이 예상대로 작동합니다.
그러나 나는 방금 슈퍼 프로젝트를 복제했고, 내가해야 할 일을했다 : "git submodule init", 서브 모듈의 디렉토리가 나타나도록했지만 비어있다.
내가 지금 시도한다면
git submodule update
나는 얻다
fatal: Needed a single revision
Unable to find current revision in submodule path 'external_libraries/BEACHhtml'
내가 시도하면
git submodule foreach git pull
나는 얻다
Entering 'external_libraries/BEACHhtml'
fatal: Where do you want to fetch from today?
Stopping at 'external_libraries/BEACHhtml'; script returned non-zero status.
내 .git / config에 다음이 있습니다.
[submodule "external_libraries/BEACHhtml"]
url = git@github.com:interstar/BEACHhtml.git
내 .gitmodules에는 다음이 있습니다.
[submodule "external_libraries/BEACHhtml"]
path = external_libraries/BEACHhtml
url = git@github.com:interstar/BEACHhtml.git
누구든지 무엇이 빠졌는지 알고 있습니까?
현재 (2019 년) 최신 GIT 클라이언트를 설치 하면 아래 의견에 따라 문제를 해결할 수 있는 것으로 보입니다 . 현재로서는 이것이 최상의 솔루션이 될 것입니다.
당신과 같은 문제가 있습니다. 이것은 git의 버그입니다 : http://lists-archives.com/git/785138-git-submodule-update-is-not-fail-safe.html
간단히 말해, 문제에 대해 다음을 시도하십시오.
# rm -rf external_libraries/BEACHhtml
# git submodule update
이전 체크 아웃 폴더에 문제가있는 것 같습니다. 제거하고 다시 업데이트하면 문제가 해결됩니다.
나는이 문제 (나는이 같은 서브 모듈의 체크 아웃을 떨어있어 그래서 비정상적인 네트워크)을했고 나는이 스크립트를 만들어서 그것을 해결 (로 이름 git-submodule-fix
난으로 실행할 수 있도록 git submodule-fix
)
#!/bin/bash
for arg
do
echo $arg
find . -name "`basename $arg`" | grep "$arg\$" | xargs rm -fr
done
이 즉, a에서 얻는 경우 git submodule update
fatal: Needed a single revision
Unable to find current revision in submodule path 'some/submodule/path'
하다
git submodule-fix some/submodule/path
git submodule update
2 개의 디렉토리를 삭제하고 하위 모듈을 다시 가져 와서 해결되었습니다.
- 파일
external_libraries/BEACHhtml
로 이동하여 살펴보십시오.git
. 내용은 다음과 같아야합니다.gitdir: ../../.git/modules/external_libraries/BEACHhtml
external_libraries/BEACHhtml
및.git/modules/external_libraries/BEACHhtml
디렉토리를 모두 삭제하십시오 .
이제부터는 git submodule update
오류없이 실행됩니다.
use a diff tool to compare the original clone that's working and this one. Also, what does git submodule
output. Ensure you are pointing to the same branch in each repo before you do.
I'm suspecting that you've switched to a branch or older revision where the submodule was not defined.
hope this helps
I had the same issue with a submodule on a project. When I tried to clone the submodule separately it worked well.
I've tried all of the answers above, but without success (git submodule update, ..., removing the submodule folders, ...).
The issue disappeared after update of git (from Git-1.7.11-preview20120710) to latest version (to Git-1.8.1.2-preview20130201) at the time. Strangely my colleagues had even older version, worked without any issues, but they were on Mac. I'm on Win7 64bit.
If you are reading in 2019 or later, just update the git client. Worked for me.
'Programing' 카테고리의 다른 글
일부 PHP 콘텐츠를 데모하기 위해 github에서 .html 대신 .php 페이지를 게시하는 방법은 무엇입니까? (0) | 2020.09.25 |
---|---|
base64로 이미지 소스를 설정하는 방법 (0) | 2020.09.25 |
# 1071-지정된 키가 너무 깁니다. (0) | 2020.09.24 |
Windows에서 Meld와 Git mergetool (0) | 2020.09.24 |
내 Ruby 프로그램이 실행중인 운영 체제를 어떻게 찾을 수 있습니까? (0) | 2020.09.24 |