서브 모듈을 다룰 때 git pull에 큰 문제가 있습니다. 나는 그들의 원리를 이해하기 시작했다고 생각했지만 분명히 ...서브 모듈에있는 동안 힘내 당겨 다른 서브 모듈을 만듭니다.
나는 간단한 자식 Repo Super
을 만들고 서브 모듈 module
을 만들었다. 내 첫 번째 문제는 module
(텍스트 파일 추가)에서 커밋을하고 코드를 밀어 넣으면 텍스트 파일이 하위 모듈 module
에 들어 가지 않지만 실제로는 수퍼 프로젝트에 들어갑니다. Super
(하위 모듈 github에 심지어 보이지 않는다). 그래서 내가 자식을 잡아 당길 때 Super
이미 내 서브 모듈에서 푸시 한 내 레포의 로컬 복사본에있는 텍스트 파일로 끝납니다 ... 내가 뭘 잘못하고 있는지 확실하지 않습니다.
cd module (a text file "Test" was added to be commited)
~/Super/module [master]: git add -A
~/Super/module [master]: git commit -m 'comment'
~/Super/module [master]: git push
cd Super
~/Super [master] : git pull
and now the text file "Test" shows up in my Super next to the submodule "module".
그래서이 이미 문제가 있지만, 나는 그와 함께 살 수 있습니다 : 여기에 기본적으로 코드입니다. 이제 내 Super
에 들어가서이 텍스트 파일을 삭제하고 최신 서브 모듈 커밋을 재발 명하기 위해 서브 모듈 module
에 대한 변경 사항을 추가하십시오.
(after deleting the text file)
~/Super [master] : git add -A
~/Super [master] : git commit -m 'comment 2'
~/Super [master] : git submodule update
~/Super [master] : git pull
~/Super [master] : git push
나는 지금 내 서브 모듈에 가서 자식이
~/Super/module [master]: git pull
을 끌어 할이 슈퍼에있는 모든 복사본을 생성하고 서브 모듈 module
에 넣어. 따라서 module
에서 ls
을 수행하면 중첩 된 서브 모듈 module
이 발견되는데 큰 문제입니다.
내 서브 모듈을 누르면 내 superproject를 업데이트 한 후 내 서브 모듈 당기는 때 사본이 superproject
로 이동, 그것은이를 만듭니다
~/Super/module/module [master]:
그래서 나는 기본적으로이 문제가 중첩 된 서브 모듈.
아무도 내가 뭘 잘못하고 있다고 말할 수 있습니까? 이것이 너희들에게 명백하게 보일지 모르겠다면 매우 유감 스럽지만, 나는이 문제에 열중하고있어 매우 실망 스럽다.
나는 슈퍼에서 .gitmodules 파일과 .git/설정을 추가했습니다 :
.gitmodules :
[submodule "module"]
path = module
url = [email protected]:titocazou/Super.git
.git/구성 :
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = [email protected]:titocazou/Super.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[submodule "module"]
url = [email protected]:titocazou/Super.git
Super repo에있는'.gitmodules' 파일과'.gitmodules' 파일의 내용을 모두 추가 할 수 있다면 도움이 될 것입니다.git/config'를 Super와 모듈 repos에서 사용합니다. – Amber