First switch to the branch you merged into (likely develop
), then
git log --since=2024-10-01 --reverse --merges \
--author="$(git config --get user.name)" >merges.txt
Now switch to the target branch you want to merge into (maybe release-20240501
or so)
Finally go through file merges.txt
top down, and for every commit hash you want to cherry-pick:
git cherry-pick [commit-hash] -m 1
Done!
MORE...
- if you get unexpected merge conflicts which make no sense, the cherry-picked commit is likely already merged into the target branch;
git cherry-pick --abort
- if you want inspect the changes of a certain commit, use
git diff <hash>~ <hash>
- if you want to see if the commit is already included in the active branch:
git branch $(git symbolic-ref --short HEAD) --contains <hash>