Suppose my story looks like this:
(2A)
/ \
(A)
\ / /
(1A)
Later, I understand that the branch dev-01is incorrect, so I want to return all merges from dev-01to master, but not from other branches.
I know this command will do the trick:
$ git revert -m1 <sha_m2> <sha_m1>
Or even best with one re-commit:
$ git revert -nm1 <sha_m2> <sha_m1>
$ git commit -m "Revert all from branch 'dev-01'"
The problem is that I do not know how to (programmatically) find merges from branch dev-01to master. Because this command:
$ git log --merges master
Show merging with a branch dev-02too. I know that if I leave Git to generate a merge message for me ( Merge branch 'd1'for example), then I can easily filter branches with some bash script, but what if I did not?
, master dev-01 fork, dev-01 master? ( ?)