generated from template/apps-template
Compare commits
2 Commits
081add5316
...
3d50fde0eb
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d50fde0eb | |||
| 664350ebf6 |
25
demodule.sh
25
demodule.sh
@@ -1,22 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "🧹 正在移除所有 Git Submodule 配置(保留文件)..."
|
||||
|
||||
# 1. 取消注册所有子模块(关键!保留文件)
|
||||
git submodule foreach --quiet 'git submodule deinit -- "$name"'
|
||||
|
||||
# 2. 删除 .gitmodules 中的所有子模块配置段
|
||||
git config -f .gitmodules --remove-section submodule 2>/dev/null
|
||||
|
||||
# 3. 从 Git 索引中移除所有子模块(不删文件!)
|
||||
git submodule foreach --quiet 'git rm --cached "$name"'
|
||||
|
||||
# 4. 清理残留的 .git/modules/ 目录(保险)
|
||||
rm -rf .git/modules/* 2>/dev/null
|
||||
|
||||
# 5. 提交变更
|
||||
git add .gitmodules
|
||||
git add --all
|
||||
git commit -m "Remove all submodules, keep files" 2>/dev/null && echo "✅ 已提交变更" || echo "ℹ️ 无变更需提交(可能已清理)"
|
||||
|
||||
echo "🎉 所有子模块配置已移除,文件全部保留!"
|
||||
# !/bin/sh
|
||||
## 功能:彻底删除 git 子模块相关信息
|
||||
git submodule deinit -f . && rm -rf .git/modules && git rm -f $(git config --file .gitmodules --get-regexp path | awk '{print $2}') && rm -f .gitmodules
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@kevisual/apps-template",
|
||||
"name": "@kevisual/noco-auto",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
@@ -9,7 +9,7 @@
|
||||
"build:web": "cd frontend && pnpm build",
|
||||
"serve": "cd backend && bun run src/main.ts",
|
||||
"init": "git submodule update --init --recursive",
|
||||
"clean:module": "rm .gitmodules -rf && sh demodules.sh"
|
||||
"clean:module": "sh demodules.sh"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||
|
||||
Reference in New Issue
Block a user