I have created a file called test. in it i made two commits from master branch content inside the test file is 1(1st commit) & 2(2nd commit), i have created a feature branch, in it i have made three commits as follows 3(3rd commit)),4(4th commit),5(5th commit).now there are 5 commits totally, 2 is in master branch & 3 is in feature branch.
Now i need to pick only the fourth commit that i have in feature branch. as i have checked out to the master branch i am entering git cherry-pick commit-i'd. but its throwing the error which is
git cherry-pick bb87e7b
error: could not apply bb87e7b... Fourth Commit
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
i sensed where the problem is...the master branch doesn't have third commit which feature branch do. so obviously the third commit content will be missing in the master branch. but as per cherry-pick's logic we should be able to do this action in one way or other.
If anyone knows the answer please explain in-detial or if you needed any supporting document to solve this error reply here. i will share that here. Thank you!