サイトマップ 連絡先 最初に戻る 戻る 次へ進む
$Date: 2018-07-07 06:49:13 +0900 (2018/07/07 (土)) $
$Revision: 1347 $

git の submodule を最新に更新する

手順

git submodule foreach を使います。
git submodule foreach git stash
git submodule foreach git checkout master
git submodule foreach git pull origin master

実行例

  1. 念のため、変更を退避します。
    C:\gitwork\GitHub\googletest-sample-cmake>git submodule foreach git stash
    Entering 'googletest'
    No local changes to save
    
  2. master をチェックアウトします。
    C:\gitwork\GitHub\googletest-sample-cmake>git submodule foreach git checkout master
    Entering 'googletest'
    Already on 'master'
    Your branch is up to date with 'origin/master'.
    
  3. 最新の修正を取り込みます。
    C:\gitwork\GitHub\googletest-sample-cmake>git submodule foreach git pull
    Entering 'googletest'
    remote: Counting objects: 56, done.
    remote: Total 56 (delta 36), reused 36 (delta 36), pack-reused 20
    Unpacking objects: 100% (56/56), done.
    From https://github.com/google/googletest
       cc372a0..1865eca  master     -> origin/master
    Updating cc372a0..1865eca
    Fast-forward
     .travis.yml                      |  83 +++++++++++++-------
     CONTRIBUTING.md                  | 160 +++++++++++++++++++++++++++++++++++++++
     LICENSE                          |  28 +++++++
     README.md                        |  32 +-------
     ci/build-linux-bazel.sh          |  35 +++++++++
     ci/env-linux.sh                  |  41 ++++++++++
     ci/env-osx.sh                    |  40 ++++++++++
     ci/install-linux.sh              |  49 ++++++++++++
     ci/install-osx.sh                |  39 ++++++++++
     ci/log-config.sh                 |  51 +++++++++++++
     travis.sh => ci/travis.sh        |   0
     googlemock/CMakeLists.txt        |   4 +-
     googlemock/README.md             |  32 --------
     googlemock/docs/DevGuide.md      | 132 --------------------------------
     googlemock/docs/Documentation.md |   2 +-
     googletest/CMakeLists.txt        |   4 +-
     googletest/README.md             |  35 ---------
     googletest/docs/DevGuide.md      | 130 -------------------------------
     googletest/docs/Documentation.md |   2 +-
     19 files changed, 506 insertions(+), 393 deletions(-)
     create mode 100644 CONTRIBUTING.md
     create mode 100644 LICENSE
     create mode 100755 ci/build-linux-bazel.sh
     create mode 100755 ci/env-linux.sh
     create mode 100755 ci/env-osx.sh
     create mode 100755 ci/install-linux.sh
     create mode 100755 ci/install-osx.sh
     create mode 100755 ci/log-config.sh
     rename travis.sh => ci/travis.sh (100%)
     delete mode 100644 googlemock/docs/DevGuide.md
     delete mode 100644 googletest/docs/DevGuide.md
    
  4. 内容を確認して git add してコミットして push します。