diff --git a/bin/update_submodules.sh b/bin/update_submodules.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9dcb9745849c01bbf61b9ffae92c5c7cc21a5a8f
--- /dev/null
+++ b/bin/update_submodules.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+git submodule update --init
diff --git a/bootstrap/etc/lofar20rc.sh b/bootstrap/etc/lofar20rc.sh
index e3bc4ac1e71c43a92a5b7f2ee8f05339b92edeaf..9a9dd658b56f5d30bb1ff8c5de692bd8fe2164de 100755
--- a/bootstrap/etc/lofar20rc.sh
+++ b/bootstrap/etc/lofar20rc.sh
@@ -12,6 +12,10 @@
 ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
 export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)}
 
+if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then
+  alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git"
+fi
+
 # This needs to be modified for a development environment.
 # In case you run multiple Docker networks on the same host in parallel, you need to specify a unique
 # network name for each of them.