react-phone-apps/init-git.ps1
lanrtop a0929de768 chore: 初始化项目结构与蓝图
- 配置 pnpm workspace monorepo 基础结构
- 初始化 .blueprint/ 蓝图:6 个业务模块、21 张任务卡
- 目标:Z Fold 6 折叠屏不动产物品摸底统计 App(React Native + Expo)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-07 15:23:39 +09:00

49 lines
1.3 KiB
PowerShell

Write-Host "初始化 Git 仓库..."
# 检查是否已经是 Git 仓库
if (Test-Path .git) {
Write-Host "✓ 已经是 Git 仓库"
git status
exit 0
}
# 初始化 Git
Write-Host "初始化 Git 仓库..."
git init
# 配置用户信息(如果未设置)
$gitUser = git config --global user.name
$gitEmail = git config --global user.email
if (-not $gitUser) {
Write-Host "提示: 请设置 Git 用户信息:"
Write-Host " git config --global user.name 'Your Name'"
Write-Host " git config --global user.email 'your.email@example.com'"
}
# 添加文件
Write-Host "添加文件到暂存区..."
git add .
# 检查是否有文件被添加
$staged = git status --porcelain
if (-not $staged) {
Write-Host "警告: 没有文件被添加到暂存区,可能是 .gitignore 过滤了所有文件"
Write-Host "查看当前状态:"
git status
exit 0
}
# 创建初始提交
Write-Host "创建初始提交..."
git commit -m "Initial commit: React phone apps project"
Write-Host "`n✓ Git 仓库初始化完成!"
Write-Host "当前分支: $(git branch --show-current)"
Write-Host "提交记录:"
git log --oneline -3
Write-Host "`n下一步:"
Write-Host "1. 连接到远程仓库: git remote add origin <repository-url>"
Write-Host "2. 推送到远程: git push -u origin main"
Write-Host "3. 查看状态: git status"