Skip to content

Commit 441561a

Browse files
committed
Script dev add init_submodules
1 parent 51012f4 commit 441561a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/dev/init_submodules.sh

+11
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)