快速迁移和恢复Mac开发环境的自动化工具集。
- 收集配置文件
./scripts/collect_configs.sh- 收集软件包信息
./scripts/collect_packages.sh- 提交到版本控制
git add -A
git commit -m "收集当前环境配置"
git push- 克隆项目
git clone <your-repo-url>
cd 环境迁移- 运行自动安装脚本
./scripts/install.sh- 验证安装结果
./scripts/verify.sh环境迁移/
├── configs/ # 配置文件
│ ├── .zshrc
│ ├── .gitconfig
│ ├── vscode/
│ └── ssh/
├── scripts/ # 执行脚本
│ ├── collect_configs.sh # 配置收集脚本
│ ├── collect_packages.sh # 软件包收集脚本
│ ├── install.sh # 主安装脚本
│ └── verify.sh # 验证脚本
├── packages/ # 软件包信息
│ ├── Brewfile
│ ├── npm_global_packages.txt
│ └── requirements.txt
└── docs/ # 文档
- ✅ Homebrew + 所有已安装的包
- ✅ VSCode (设置 + 插件)
- ✅ Git 全局配置
- ✅ SSH 配置
- ✅ Node.js + nvm + npm全局包
- ✅ Python + pyenv + pip包
- ✅ Shell配置 (.zshrc, .bashrc)
- ✅
.zshrc- Zsh配置 - ✅
.gitconfig- Git全局配置 - ✅
.ssh/config- SSH配置 - ✅
.vimrc- Vim配置 - ✅
.tmux.conf- tmux配置 - ✅ VSCode设置和插件
- 收集配置: ~5分钟
- 新环境安装: ~20-30分钟 (取决于网络和软件包数量)
- 验证检查: ~1分钟
- SSH私钥不会自动复制,需要手动处理
- 敏感配置文件会被自动排除
- 建议在私有仓库中保存配置
- 首次使用前建议创建Time Machine备份
- 网络环境较差时可能需要多次重试
- 某些工具可能需要手动登录或激活
- 支持 macOS 10.15+
- 自动适配 Intel 和 Apple Silicon Mac
- 兼容最新版本的开发工具
-
Homebrew安装失败
# 手动安装Homebrew /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
VSCode插件安装失败
# 手动安装插件 cat configs/vscode/extensions.txt | xargs -n 1 code --install-extension
-
Node.js版本问题
# 重新安装nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
运行验证脚本检查安装状态:
./scripts/verify.sh在 collect_configs.sh 中添加:
[ -f ~/.your_config ] && cp ~/.your_config "$BACKUP_DIR/"在 install.sh 的符号链接部分添加:
".your_config"在 collect_packages.sh 中添加收集逻辑,在 install.sh 中添加安装逻辑。
欢迎提交Issue和Pull Request来改进这个工具。
MIT License