We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51012f4 commit 441561aCopy full SHA for 441561a
scripts/dev/init_submodules.sh
@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+git submodule update --init --recursive
4
+# Fetch the latest changes for each submodule and check out the default branch
5
+git submodule foreach --recursive '
6
+ default_branch=$(git remote show origin | grep "HEAD branch" | cut -d: -f2 | tr -d " ")
7
+ echo "Updating submodule $name to latest commit on $default_branch branch"
8
+ git fetch origin $default_branch
9
+ git checkout $default_branch
10
+ git pull origin $default_branch
11
+'
0 commit comments