|
|
|
@ -1,10 +1,25 @@
|
|
|
|
|
# Cherry-picks a commit ID from main branch to all the other branches
|
|
|
|
|
$CommitID = "1234"
|
|
|
|
|
$CommitMessage = "Update rules for .gitignore file (cherry-picked from main branch)"
|
|
|
|
|
$RepoDir = "D:\Repos\ufa"
|
|
|
|
|
$Branches = "attower_bugfix_14.43.x", "attower_bugfix_14.42.x", "attower_bugfix_14.41.x", "attower_bugfix_14.40.x", "attower_bugfix_14.39.x", "attower_bugfix_14.38.x", "attower_bugfix_14.37.x", "attower_bugfix_14.36.x", "attower_bugfix_14.35.x", "attower_bugfix_14.34.x", "attower_bugfix_14.33.x", "attower_bugfix_14.32.x", "attower_bugfix_14.31.x", "attower_bugfix_14.30.x", "attower_bugfix_14.29.x", "attower_bugfix_14.27.x", "attower_bugfix_14.26.x", "attower_bugfix_14.25.x", "attower_bugfix_14.24.x", "attower_bugfix_14.23.x", "attower_bugfix_14.22.x", "attower_bugfix_14.21.x", "attower_bugfix_14.20.x", "attower_bugfix_14.19.x", "attower_bugfix_14.18.x", "attower_bugfix_14.17.x", "attower_bugfix_14.16.x", "attower_bugfix_14.15.x", "attower_bugfix_14.13.x", "attower_bugfix_14.11.x", "attower_bugfix_14.10.x", "attower_bugfix_14.9.x", "attower_bugfix_14.8.x", "attower_bugfix_14.6.x", "attower_bugfix_14.5.x", "attower_bugfix_14.4.x"
|
|
|
|
|
#!/bin/powershell
|
|
|
|
|
<#
|
|
|
|
|
.SYNTAX ./cherry-picker.ps1 [<commit-id>] [<commit-message>] [<branches>] [<repo-dir>]
|
|
|
|
|
.DESCRIPTION cherry-picks a Git commit into multiple branches
|
|
|
|
|
.LINK https://github.com/fleschutz/PowerShell
|
|
|
|
|
.NOTES Author: Markus Fleschutz / License: CC0
|
|
|
|
|
#>
|
|
|
|
|
|
|
|
|
|
param($CommitID = "", $CommitMessage = "", $Branches = "", $RepoDir = "$PWD")
|
|
|
|
|
|
|
|
|
|
if ($CommitID -eq "" ) {
|
|
|
|
|
$CommitID = read-host "Enter the commit id to cherry-pick"
|
|
|
|
|
}
|
|
|
|
|
if ($CommitMessage -eq "" ) {
|
|
|
|
|
$CommitMessage = read-host "Enter the commit message to use"
|
|
|
|
|
}
|
|
|
|
|
if ($Branches -eq "" ) {
|
|
|
|
|
$Branches = read-host "Enter the target branches"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (-not(test-path "$RepoDir" -pathType container)) { throw "Can't access directory: $RepoDir" }
|
|
|
|
|
set-location "$RepoDir"
|
|
|
|
|
|
|
|
|
|
foreach($Branch in $Branches) {
|
|
|
|
@ -42,7 +57,6 @@ try {
|
|
|
|
|
& git push
|
|
|
|
|
if ($lastExitCode -ne "0") { throw "'git push' failed" }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
"DONE."
|
|
|
|
|
exit 0
|
|
|
|
|
} catch {
|
|
|
|
|