feat: 在同步仓库脚本中添加自动合并消息功能,优化合并流程
This commit is contained in:
parent
007c4f1431
commit
75b46c846f
@ -74,14 +74,19 @@ function Sync-Repositories {
|
|||||||
} else {
|
} else {
|
||||||
Write-ColorOutput "正在使用merge合并代码..." "Green"
|
Write-ColorOutput "正在使用merge合并代码..." "Green"
|
||||||
if (-not $DryRun) {
|
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) {
|
if ($LASTEXITCODE -ne 0) {
|
||||||
Write-ColorOutput "Merge失败!请手动解决冲突后再继续。" "Red"
|
Write-ColorOutput "Merge失败!请手动解决冲突后再继续。" "Red"
|
||||||
Write-ColorOutput "解决冲突后请运行: git commit" "Yellow"
|
Write-ColorOutput "解决冲突后请运行: git commit" "Yellow"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Write-ColorOutput "使用自动合并消息: $mergeMessage" "Gray"
|
||||||
} else {
|
} else {
|
||||||
Write-ColorOutput "[预览模式] git merge upstream/master" "Gray"
|
Write-ColorOutput "[预览模式] git merge upstream/master --no-edit -m '自动合并消息'" "Gray"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user