Say you have two branches, branchA and branchB.
Assume that in branchA you have
whereas in branchB you have
Say you want to make some change that will be common to both branchA and branchB; that is, for example, you want to add the same file to them, so that branchA shall become
and branchB shall become
To do this, you first need to commit to either branch, say branchA.
$ git checkout branchA
$ # write file4.txt
$ git add file4.txt
$ git commit file4.txt -m 'add file4'
Next, you just need to clone the very last commit using git cherry-pick
$ git checkout branchB
$ git cherry-pick branchA
If you have more branches, then simply repeat the above cherry-pick steps to branchC, branchD, and so forth.