# Direct仓库创建和推送脚本 $GIT_SERVER = "git.alicorns.co.jp" $GIT_USER = "aitest" $GIT_PASSWORD = "Aitest123456" $REPO1 = "office-file-handler" $REPO2 = "dingtalk-media-sender" Write-Host "=== Git Repository Creation and Push ===" -ForegroundColor Green Write-Host "" # 尝试方法:使用git init在本地创建,然后直接推送到远程 Write-Host "Method: Create local bare repo and push" -ForegroundColor Yellow Write-Host "" # 为每个技能创建临时裸仓库 foreach ($repo in $REPO1, $REPO2) { Write-Host "Processing $repo..." -ForegroundColor Cyan # 设置本地路径 if ($repo -eq $REPO1) { $localPath = "C:\Users\ALC\.openclaw\skills\$repo" } else { $localPath = "$env:USERPROFILE\.openclaw\skills\$repo" } # 检查本地仓库 if (!(Test-Path "$localPath\.git")) { Write-Host "Local git repo not found for $repo" continue } # 尝试推送 Set-Location $localPath $remoteUrl = "https://$GIT_USER`:$GIT_PASSWORD@$GIT_SERVER/$repo.git" Write-Host "Attempting to push to $remoteUrl" # 先尝试推送,看看是否会提示创建 $result = git push -u origin master 2>&1 if ($LASTEXITCODE -eq 0) { Write-Host "[SUCCESS] $repo pushed successfully!" -ForegroundColor Green } else { Write-Host "[FAILED] $repo push failed: $result" -ForegroundColor Red } Write-Host "" } Write-Host "=== Summary ===" -ForegroundColor Green Write-Host "If push failed, repositories need to be created manually on the Git server." -ForegroundColor Yellow