File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed
Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ echo " check source and run commands manually :)"
4+
5+ exit 5
6+
7+
8+ # Remove the submodule entry from .git/config
9+ git submodule deinit -f path/to/submodule
10+
11+ # Remove the submodule directory from the superproject's .git/modules directory
12+ rm -rf .git/modules/path/to/submodule
13+
14+ # Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
15+ git rm -f path/to/submodule
16+
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ cd ..
4+ # git submodule foreach git pull
5+ git submodule update --remote --merge
6+
Original file line number Diff line number Diff line change 55
66git pull
77
8- # TODO: add functionality to detect submodule URL changes and
9- # deinit/remove/add
8+ SUBMODULE_LIST=` git submodule status | awk ' {print $2}' `
109
10+ HAS_REPOS_W_CHANGED_URLS=" "
11+
12+ for SUBMOD in $SUBMODULE_LIST ; do
13+ cd $CWD /$SUBMOD
14+ REPO_URL=` git remote -v | grep fetch | awk ' {print $2}' `
15+ cd $CWD
16+ MANIFEST_URL=` egrep -A1 " path = $SUBMOD \$ " .gitmodules | grep url | awk ' {print $3}' `
17+ if [ " $MANIFEST_URL " != " $REPO_URL " ]; then
18+ echo " changed repo URL $SUBMOD $REPO_URL $MANIFEST_URL "
19+ HAS_REPOS_W_CHANGED_URLS=" YES"
20+ rm -rf $CWD /$SUBMOD
21+ rm -rf $CWD /.git/modules/$SUBMOD
22+ fi
23+ done
24+
25+ cd $CWD
26+ git submodule sync
27+ git submodule update --init --recursive --depth 100 -j 3
1128git submodule update --remote --merge
You can’t perform that action at this time.
0 commit comments