私はgitリポジトリmainrepo
をクローンしました。サブモジュールはsubmodule1
です。私は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( 'git --version')ですか? – larsks
そのコンピュータのgitバージョンは1.7.1です...リモートサブモジュールの更新は私のパーソナルコンピュータで動作し、gitバージョンは2.9.0にアップデートされています。 – kaligne