Skip to content

Commit b9296b0

Browse files
committed
dev/git: git submodule update commands
1 parent 4b2aed7 commit b9296b0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/dev/git.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,13 @@ git rm --cached -f src/eigen # if you've already added it to the index
297297
git submodule add <url_of_eigen> src/eigen
298298
```
299299

300+
初始化、更新 submodule 等操作则使用 `git submodule update` 命令:
301+
302+
```bash
303+
git submodule update --init --recursive # clone 后初始化并拉取 submodule
304+
git submodule update --remote --recursive # 更新 submodule 到远程最新版本
305+
```
306+
300307
### Stash {#git-stash}
301308

302309
有的时候,我们在工作目录中进行了一些修改,还没有 commit(例如还没有完全完成),但是需要切换到其他分支进行一些操作。这时可以使用 `git stash` 将当前的修改放在 stash 中,操作完成后,可以使用 `git stash pop` 将修改恢复到工作目录中。

0 commit comments

Comments
 (0)