a-cloud-all/use.md

51 lines
1.3 KiB
Markdown
Raw Normal View History

2026-01-09 19:15:45 +08:00
## RuoYi-Cloud 代码拉取说明
## 首次克隆代码
```bash
git clone --recurse-submodules http://th.local.t-aaron.com:13000/THENG/a-cloud-all.git
cd a-cloud-all
```
## 日常更新代码(推荐)
```bash
# 更新主仓库和所有子模块到主仓库记录的版本
git pull && git submodule update --init --recursive
```
## 其他更新方式
### 方式1更新子模块到各自远程的最新版本
```bash
git pull && git submodule update --remote --recursive
```
2026-01-10 12:56:05 +08:00
### git submodule foreach 'git checkout main && git pull'
### 方式2创建别名简化操作
```bash
# 配置别名(只需执行一次)
git config alias.pullall '!git pull && git submodule update --init --recursive'
# 之后使用别名更新
git pullall
```
## 常用子模块命令
```bash
# 查看子模块状态
git submodule status
# 在所有子模块中执行命令
git submodule foreach 'git status'
git submodule foreach 'git pull origin main'
# 更新特定子模块
git submodule update --remote ruoyi-gateway
```
## 注意事项
- `git pull --recurse-submodules` 只会拉取主仓库,不会自动更新子模块代码
- 必须执行 `git submodule update` 才会真正拉取子模块的代码
- `--init` 参数会初始化还未初始化的子模块
2026-01-09 19:15:45 +08:00
- `--recursive` 参数会递归更新所有嵌套的子模块