From 97edaee6166b9a037119ab019378effd06dbc0cd Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 8 Oct 2020 18:18:19 +0200 Subject: [PATCH] aggiunta script x push update --- gitSpread.ps1 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 gitSpread.ps1 diff --git a/gitSpread.ps1 b/gitSpread.ps1 new file mode 100644 index 00000000..2c11b7c5 --- /dev/null +++ b/gitSpread.ps1 @@ -0,0 +1,37 @@ +# Script di creazionereplica su altri rami di un branch git + + + +# Check parameters +Param ( + [Parameter(Mandatory=$True)] + [ValidateNotNull()] + $baseBranch, + [Parameter(Mandatory=$True)] + [ValidateNotNull()] + $pushRemote +) +# recupera timestamp x logging +function Get-TimeStamp +{ + return "[{0:MM/dd/yy} {0:HH:mm:ss}]" -f (Get-Date) +} + +#Write-Output "$(Get-TimeStamp) $baseBranch" + +# ora eseguo push su TUTTI i branch locali... +git push . $baseBranch:develop +git push . $baseBranch:Euromap63 +git push . $baseBranch:IobMan +git push . $baseBranch:Master +git push . $baseBranch:MTC + +# SE richiesto fa push sul remote... +if($pushRemote -eq "y") +{ + git push gitlab.steamware $baseBranch:develop + git push gitlab.steamware $baseBranch:Euromap63 + git push gitlab.steamware $baseBranch:IobMan + git push gitlab.steamware $baseBranch:Master + git push gitlab.steamware $baseBranch:MTC +} \ No newline at end of file