I have the following git structure: local/develop, local/feature-x, origin/develop, origin/feature-x, origin/feature-y... each local is tracking its corresponding origin, and there is another developer working on feature-y and pushes his code to origin/feature-y.
While I am working on feature-x and pushing my code to origin/feature-x for -let's say- several days, the other developer has done a Merge-Request to origin/develop, and now, I need his code to be able to continue my work on feature-x, I have 2 options to update my local/feature-x code but each one has a drawback (please note that this scenario implies that feature-x should appear as the most-recent feature when seeing the history of the commits in origin/develop):
merge origin/develop into local/feature-x -> this will re-write the git-history and make feature-x commits appears behind feature-y commits and I want to avoid that.
rebase local/feature-x onto origin/develop -> this will make the history of local/feature-x differs from the history of its tracked version (i.e., origin/feature-x) then git will force me to pull origin/feature-x commits to local/feature-x and thus, having a duplicated of commits in local/feature-x and making the history looks ugly!
What are the ways to update the local/feature-x branch w-r-t having a meaningful git-history?