하위 모듈이 submodule1
인 자식 저장소 (mainrepo
)를 복제했습니다. 내가 submodule1
에서 최신 업데이트를받을 때 :git submodule update --remote가 작동하지 않습니다.
$ cd mainrepo
$ git submodule add [email protected]:myaccount/submodule1.git
$ git submodule update --remote submodule1
Usage: git submodule [--quiet] add [-b branch] [--reference <repository>] [--] <repository> [<path>]
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: git submodule [--quiet] init [--] [<path>...]
or: git submodule [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: git submodule [--quiet] foreach [--recursive] <command>
or: git submodule [--quiet] sync [--] [<path>...]
$ git submodule update --remote
Usage: git submodule [--quiet] add [-b branch] [--reference <repository>] [--] <repository> [<path>]
or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
or: git submodule [--quiet] init [--] [<path>...]
or: git submodule [--quiet] update [--init] [-N|--no-fetch] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
or: git submodule [--quiet] foreach [--recursive] <command>
or: git submodule [--quiet] sync [--] [<path>...]
를 내가 한 번 submodules
이 방법을 업데이트하려고 확신, 워드 프로세서 이렇게도 할라고, 아직 작동하지 않는 이유를 이해하지 않습니다.
하지만이 페치와 submodule
에 직접 병합 경우,이 최신 저장소에 업데이트 될 때 내가 그것을 원하는대로 커밋 :
$ cd submodule1
$ git fetch && git merge master
하지 않는 이유는 무엇 submodule update --remote submodule1
명령을 사용할 수 있습니까?
$ vim mainrepo/.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:myaccount/mainrepo.git
[branch "master"]
remote = origin
merge = refs/heads/master
[submodule "local/src/utils"]
url = [email protected]:myaccount/submodule1.git
$ vim .gitmodules
[submodule "submodule1"]
path = submodule1
url = [email protected]:myaccount/submodule1.git
어떤 버전의 자식 ('git --version')입니까? – larsks
그 컴퓨터에있는 쓰레기 자식 버전은 1.7.1입니다 ... 원격 서브 모듈 업데이트는 개인용 컴퓨터에서 작동하며 자식 버전은 2.9.0으로 업데이트됩니다. – kaligne