Skip to content

Instantly share code, notes, and snippets.

@jmrnilsson
Last active October 7, 2019 08:18
Show Gist options
  • Save jmrnilsson/e1e903a9841ba99420156cb1a1927f11 to your computer and use it in GitHub Desktop.
Save jmrnilsson/e1e903a9841ba99420156cb1a1927f11 to your computer and use it in GitHub Desktop.
Push empty commits to git for some branches
#!/usr/bin/env pwsh
git fetch --all
$branches = ('branch0',
'branch1',
'branch2',
);
foreach ($branch in $branches) {
Write-Host "Pushing empty commit to $branch";
git checkout "$branch";
git commit --allow-empty -m "empty commit (start ci pr build)";
git push origin "$branch";
Write-Host "Done.."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment