Reapply patches to updates (Git)

Let’s asume you have a repo containing an external SW. (forked repo or specific version)

   Branches   |   Commits
--------------|---------------
    master    | last_for_v1.0
              |  (Tag: v1.0)

For a proper usage in your project you possibly have to implement/apply some patches.

   Branches   |   Commits
--------------|---------------------------
    master    | last_for_v1.0
              |  (Tag: v1.0)
              |       ↓
 v1.0_patched |    patch_1 --> patch_2
              |              (Tag: v1.0p)

After updating to a newer version you most likely have to apply your patches again.

   Branches   |   Commits
--------------|------------------------------------------------
    master    | last_for_v1.0 -..->  last_for_v2.0
              |  (Tag: v1.0)          (Tag: v2.0)
              |       ↓                    |
 v1.0_patched |    patch_1 --> patch_2     |
              |              (Tag: v1.0p)  |
              |                            ↓
 v2.0_patched |                         patch_1 --> patch_2
              |                                   (Tag: v2.0p)
$ git checkout v2.0
$ git checkout -b v2.0_patched
$ git cherry-pick $(git merge-base master v1.0_patched)..v1.0_patched