---
# System prepended metadata

title: '[Git] 更新子模組'
tags: [Git]

---

# [Git] 更新子模組
[TOC]
## 進到專案資料夾執行 git 命令

```=git
$ git submodule update --remote
```

:::warning
配置檔必須有以下設定

    [submodule]
	    recurse = true
    [push]
	    recursesubmodules = check
:::

## 查看目前 git 狀態
```
$ git status
```

## 提交檔案到目前分支

將檔案(子模組)提交
```
$ git add <file_path>
```

提交並加上描述
```
$ git commit -m "chore: 子模組參照更新"
```

## 推送
```
$ git push
```

