Updating fork of Unreal to get latest version

I have a fork of Unreal I made in 4.15, and now I want to update it to 4.16.

I’ve tried the regular fork update process:

git remote add upstream https://github.com/EpicGames/UnrealEngine.git
git fetch upstream
git merge upstream/4.16

This failed because some file existed that I didn’t create in emscripten, so I deleted it.

Now I have a huge merge list, and no way to just say “Accept all changes”…?
What’s the easiest way to just get the latest version? I have some changes I’ve made to the engine but they’re hidden in with 16000 other additions/changes… How can I merge easily?

You can use git cherry-pick to pick what you changed in 4.15 to your 4.16 fork,
using commands like that:

Thanks for the suggestion.

So to understand what your commands do…

git checkout upstream/4.16 this checks out and downloads the version 4.16
git checkout -b my_4.16 this creates a new branch called my_4.16
git cherry-pick ??? what do I put in the ??? I have to refer to a commit number?

Sorry Git is still very confusing to me, coming from P4

No problem. Git sometimes could be quite confuse, been there myself.

git checkout upstream/4.16 This checks out files to your working directory. (**git fetch upstream ** downloads all the code and history from upstream repository)

git checkout -b my_4.16 Yes, this creates a new branch : my_4.16

git cherry-pick ??? You are right, ??? should be the commit number you like to merge into your my_4.16 branch.

When you changed engine files in your local 4.15 branch, you should add and commit what you changed to your own 4.15 branch:

Nate… When Epic does these “Super Commits” for tons of changes to the Engine, your stuck right…? I guess it make sense on their part in having one large commit with a bunch of changes rather than a bunch of small ones… But, for folks who want to maintain their own engine doesn’t it complicate things a bit. Thanks for your insight on the Cherry Picking. I’ve only been successful once at it and I think I got lucky!

teak

@teak421, yes, the “super commit” do make picking particular feature/bug fixing difficult, but as that’s not something I’ll do very often I can totally live with that :slight_smile:

I use cherry-pick mostly for migrating my own branch to major engine update, if it’s in same major engine cycle, I just rebase my branch.

Cherry picking your changes into a fresh fork of a newer version seems “dirty”, but it’s the less problem-prone way to do it in my experience. Merging and re-basing always causes problems like conflicts on code I never modified or duplicated code blocks that sometimes escape git and go all the way to blowing up compilation. I suspect this is due to Epic doing changes outside of git (using Perforce) which causes the changes to show up as unique commits in different branches (eg: 4.15 and 4.16).