Using git you can just diff between branches. So you have the diff between the destination branch from your feature branch and you just want to "put your code changes" together Accordin to https://stackoverflow.com/a/22390257/1345527
To create the patch :
git diff dev > master.patch
To apply it :patch < master.patch
In theory, if diff and git diff are similar you could do the following to put your code changes on top of a target branch (usually when doing a MR to master).
git checkout master (or other target branch)
git diff (your-source-branch ) > final-destination.patch
patch final-destination.patch
Patch is a linux command
NAME
patch - apply a diff file to an original
SYNOPSIS
patch [options] [originalfile [patchfile]]
but usually just
patch -pnum < patchfile
Another answer on the same question recommends simply using git.
Git kraken has a post on using git patches: https://www.gitkraken.com/learn/git/git-patch#Git-Create-Patch
Take note that applying patches is technically going to result in the same result as fixing merge conflicts,
but it will just one commit. Git merge on the other hand will bring in all your commit history into the branch, which make it harder to revert, especially if the commits aren't tagged with a ticket number properly.
Now if ever your changes in your feature branch are to be discarded, it's just a simple git revert away