Typical usage scenario:
I have master, branch_foo and branch_bar. All are up to date. Now, I do a “git checkout master” and work on a bug fix.
Lets say that fix was on a tracked file that is in the same state on all branches – ie. before the fix, a diff of the file from each branch results in no differences.
Is there a way to commit this fix to all branches?
I expect
git cherry-pickis what you want.After committing the fix to the first branch, you can use
git cherry-pickto merge it into each of the other branches.This related question on SO may be of interest:
Git & Working on multiple branches