Commit a change to more than one branch in Git
问题 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? 回答1: I expect git cherry-pick is what you want. After committing the fix to the first branch, you can use git cherry-pick to merge it