Today I had to commit one change into two different branches (master and google). After googling for some time I found out that GIT has a way of picking one commit hash from a branch and apply it onto another branch.
i.e. If we commit a change into google branch and want that commit to be applied into the master branch too then we get the hash code of the commit from the google branch using the command “git log” and apply the commit hash onto the master branch using the following command.
git cherry-pick [commit-hash]
The sequence of commands in my case was as follows: (branches master and google):
git checkout googlegit pull origin google
[always pull before commit and push]git commit -a -m "committing all changes to google branch"git push origin googlegit log
[get the hashcode for the commit above and lets call it 62abc3]git checkout mastergit pull
[always pull before commit and push]git cherry-pick 62abc3