a-cloud-all/use.md

60 lines
2.1 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## RuoYi-Cloud 代码拉取说明
a
## 首次克隆代码
```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
git submodule foreach 'git checkout main && git pull'
git submodule foreach 'git checkout dev && git pull'
```
## 其他更新方式
### 方式1更新子模块到各自远程的最新版本
```bash
git pull && git submodule update --remote --recursive
```
### 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` 参数会初始化还未初始化的子模块
- `--recursive` 参数会递归更新所有嵌套的子模块
## 在根目录提交各个模块的修改
cd ruoyi-modules/tuoheng-airline && git add . && git commit -m "修改端口" && git push && cd .. && cd ..
cd ruoyi-modules/tuoheng-approval && git add . && git commit -m "修改端口" && git push && cd .. && cd ..
cd ruoyi-modules/tuoheng-device && git add . && git commit -m "修改端口" && git push && cd .. && cd ..
cd ruoyi-modules/tuoheng-fms && git add . && git commit -m "修改端口" && git push && cd .. && cd ..
cd ruoyi-modules/tuoheng-media && git add . && git commit -m "修改端口" && git push && cd .. && cd ..
cd ruoyi-modules/tuoheng-task && git add . && git commit -m "修改端口" && git push && cd .. && cd ..