答: 操作步驟如下:
$ cd <submodule dir> (進入子模塊的源碼目錄)
$ git checkout my-branch (切換到要使用的分支)
$ cd .. (退出子模塊)
$ git status (檢查commit的修改)
--- a/submodule
+++ b/submodule
@@ -1 +1 @@
-Subproject commit 0000000000000000000000000000000000000000
+Subproject commit 1111111111111111111111111111111111111111
$ git commit -s -m 'switch branch of submodule' (下次獲取子模塊時,將會直接將commit切換到這個指定的commit 1111111111111111111111111111111111111111)
$ git push (上傳代碼)