Skip to content

Commit e1cf44d

Browse files
committed
Script dev add init_submodules
1 parent 49d2f2e commit e1cf44d

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

scripts/dev/init_submodules.sh

Lines changed: 11 additions & 0 deletions
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)