How to merge your changes by commit ID from one branch to another in GIT

How to merge your changes by commit ID from one branch to another in GIT

1. When you have more than one commits is available in your branch but only specific commit

changes you have to merge to master in that case git merge <BRANCH NAME> won’t work.

2. In this case we can able to merge our changes by commit ID or revision ID.

3. Follow below steps to merge specific commit change. Here i want to merge my first_branch

recent revision to master branch
4.1) Now am in first_branch

git log –pretty=onelinea92b8872af11677d35b16bda14bf7087e587907e

now am going to merge this to master by version

02837986864a91e84db7a88c424fb3b81dd23d1803 (Am going to omit to merge)

I had done the file name changed from first.html to first_update.html

This is my second file commit from first_branch (already merge with master)

this is my first commit in Git (already merge with master)

4.2) Here latest two commits is ready to merge with master branch rest of the commits already

merged with master branch. Now i am going to merge the a92b8872 not 02837986.

4.3) first_branch> git checkout master

4.4) MasterBranch> git cherry-pick a92b8872

4.5) Yes specific revision merge is done with master. Now check the log

4.6) MasterBranch>  git log –pretty=oneline6c987c14a84b13c55e55bb2338d813e60e69d372

now am going to merge this to master by version ID