Skip to content

Instantly share code, notes, and snippets.

@BetimBeja
Last active December 9, 2021 21:31
Show Gist options
  • Save BetimBeja/3c5d799ef988a1a69aa750012d7cec47 to your computer and use it in GitHub Desktop.
Save BetimBeja/3c5d799ef988a1a69aa750012d7cec47 to your computer and use it in GitHub Desktop.
Synchronize DynamicsValue FakeXrmEasy Repositories
param(
[string]$folder,
[bool]$mainOnly = $false
)
cd $folder
Write-Host "Syncing folder " $folder
$branch = & git branch --show-current
$changes = & git diff --shortstat
if($changes -ne $null){
& git stash
}
& git fetch upstream
if($branch -ne 'main'){
& git checkout main
}
& git merge upstream/main
& git push
if(!$mainOnly){
& git checkout 3x
& git merge upstream/3x
& git push
}
if(!$mainOnly){
& git checkout 2x-dev
& git merge upstream/2x-dev
& git push
}
if(!$mainOnly){
& git checkout 3x-dev
& git merge upstream/3x-dev
& git push
}
if($branch -ne '3x-dev' -And $mainOnly -eq $false ){
& git checkout $branch
}
if($branch -ne 'main' -And $mainOnly -eq $true){
& git checkout $branch
}
if($changes -ne $null){
& git stash pop
}
cd ..
.\SyncFork.ps1 -folder .\fake-xrm-easy-abstractions
.\SyncFork.ps1 -folder .\fake-xrm-easy-core
.\SyncFork.ps1 -folder .\fake-xrm-easy-messages
.\SyncFork.ps1 -folder .\fake-xrm-easy-plugins
.\SyncFork.ps1 -folder .\fake-xrm-easy-code-activities -mainOnly $true
.\SyncFork.ps1 -folder .\fake-xrm-easy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment