LoginSignup
4
6

More than 5 years have passed since last update.

submodule を含む Git リポジトリを make でかんたんに更新する

Last updated at Posted at 2016-04-14

こんな Makefile を置いておくことにしました。

.PHONY: update update-all all

update:
    git pull origin master
    git submodule update --init

update-all: update
    git submodule foreach git pull origin master

all: update-all

submodule が submodule を含む場合には、 git submodule update --recursive を付けるとよさそうですね。

使い方

% make     # update タスクを実行
% make all # update-all タスク(update に依存)を実行

ラッパースクリプトを作ってもいいのですけど、 make でもいいかなというところ。
色んなリポジトリに Makefile を置くよりは、スクリプト1枚で済ませた方が汎用的かもしれません。
git のサブコマンドにしてしまう手もありそうですね。

みなさんはどうしてるでしょうか。

まだ試み程度ですが、ご参考になれば幸い。

4
6
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6