The real good way to do this in git is to "recreate" your changes. What does this mean, instead of combining updates from your own repo into your changes, rewinds (cancels) all your changes, makes your changes to your branch (so everything is beautiful and linear), and then “repeats” your changes on on top of them.
This leads to the fact that your changes always basically consist of a series of “patches” on top of the repo that you follow (instead of your changes alternating with the changes when you re-move through the history).
source
share