diff --git a/自动同步仓库.ps1 b/自动同步仓库.ps1 index 03d8613..550cf40 100644 --- a/自动同步仓库.ps1 +++ b/自动同步仓库.ps1 @@ -74,14 +74,19 @@ function Sync-Repositories { } else { Write-ColorOutput "正在使用merge合并代码..." "Green" if (-not $DryRun) { - git merge upstream/master + # 生成自动合并消息 + $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" + $mergeMessage = "feat: 同步上游仓库更新 ($timestamp)" + + git merge upstream/master --no-edit -m $mergeMessage if ($LASTEXITCODE -ne 0) { Write-ColorOutput "Merge失败!请手动解决冲突后再继续。" "Red" Write-ColorOutput "解决冲突后请运行: git commit" "Yellow" return } + Write-ColorOutput "使用自动合并消息: $mergeMessage" "Gray" } else { - Write-ColorOutput "[预览模式] git merge upstream/master" "Gray" + Write-ColorOutput "[预览模式] git merge upstream/master --no-edit -m '自动合并消息'" "Gray" } }