In addition to Makoto's answer, which describes how git merge changes from a repo base branch to a branch branch, you can also consider doing git rebase . Consider the following diagram:
base branch: A <- B <- C your branch: A <- D <- E <- F
If you git rebase branches on a base branch, then your branch will look like this:
your branch: A <- B <- C <- D' <- E' <- F'
rebase allowed you to retrieve all the changes from the base branch, while maintaining the same commits that you had on your branch, and in the same order that you did in the last two years. I donโt know if this was what you had in mind when you said โkeeping our local changes as they are,โ but that might fit the bill.
You will probably also have merge conflicts, as with the merger, so get ready for the tedious fun.
source share