Skip to content

Instantly share code, notes, and snippets.

View adamlazik1's full-sized avatar

Adam Lazik adamlazik1

View GitHub Profile
@adamlazik1
adamlazik1 / README.md
Created February 27, 2023 17:48
Script for cherry-picking to version branches on foreman-documentation repository

What it does

The script cherry-picks a required number of the latest commits from the master branch to required branches. Additionally, the script copies a command to your clipboard, which when used, will push the branches with cherry-picked commits to upstream repository and will store a formatted message in your clipboard, which you then just have to paste in a comment when merging and cherry-picking a PR.

The formatted message has the following format:

Merged and cherry-picked:
  <BRANCH1_OLD_LATEST_COMMIT>..<BRANCH1_NEW_LATEST_COMMIT> -> <BRANCH1_NAME>
  <BRANCH2_OLD_LATEST_COMMIT>..<BRANCH2_NEW_LATEST_COMMIT> -> <BRANCH2_NAME>
 ...