a-cloud-all/use.md

1.2 KiB
Raw Blame History

RuoYi-Cloud 代码拉取说明

首次克隆代码

git clone --recurse-submodules http://th.local.t-aaron.com:13000/THENG/a-cloud-all.git
cd a-cloud-all

日常更新代码(推荐)

# 更新主仓库和所有子模块到主仓库记录的版本
git pull && git submodule update --init --recursive

其他更新方式

方式1更新子模块到各自远程的最新版本

git pull && git submodule update --remote --recursive

方式2创建别名简化操作

# 配置别名(只需执行一次)
git config alias.pullall '!git pull && git submodule update --init --recursive'

# 之后使用别名更新
git pullall

常用子模块命令

# 查看子模块状态
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 参数会递归更新所有嵌套的子模块