LoginSignup
4
4

More than 5 years have passed since last update.

ブランチを切り替えた時に submodule の commit がずれて苛つくのを post-checkout hook で解消する

Posted at

git submodule を使っていて、 branch間で submodule で指し示してる commit がずれてたりすると、手元で branch を切り替えた時に submodule を充ててる path が git status に現れて(少なくとも自分は)いらつく。

.git/hooks/post-checkout

#!/bin/sh

exec git submodule update

このように書いておけば、git checkout のたびに git submodule update が走るのでこの点解消される。

4
4
0

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
4