How to merge one branch (repo 1) to another branch (repo 2) for commits between two Hash numbers

i have a scenario where i am trying to merge one branch in repo A to another branch in repo B,
i was able to figure out the commands for doing so but it seems that the merge is happening for all the commits.
I need to merge the changes between two Hash Number range.

say i want to merge Branch1 (Repo1) --> Branch2 (Repo2) within Branch 1 Hash numbers range 2393878-2349293
to Branch 2

here is my code: -

git remote add old-project ../source-project
git fetch source-project
git merge -S --allow-unrelated-histories source-project/master // on this line can i put a hash range to merge ?
git push destination-project feature/source-project
git remote rm source-project

I am new to GIT so requesting brief descriptions along with your answers. Also if there is a better code approach i would request you to post that.
As with current code, the merge conflicts are coming something like this below (the whole file is conflicted even though it should not be) :- 


Thank You.

1 Like

Hey @ashishsh51911, thanks for being here. The best route to achieve what you want would actually be to undo or alter the secondary branch such that it contains only the commits you want to be merged in as there is no good way with git to only merge certain commits between a specific range. 

Let me know if you have any follow up questions!