Best practices for setting up an Engine fork for making a game

Here’s my situation,

I need a fork of the engine to make changes for the game I’m working on. Now I understand how to pull updates from an upstream repo (Epic’s) into my own fork to get new features, and I’d like to do this once a day with the promoted branch. Pulling code into my own fork to work with.

But what if I want to release a version of my game, ideally I want to do so with the release branch. But I’ve been adding my changes to the promoted branch. So somehow I need to update my release branch, and then pull my promoted branch with my changes into the release branch. This however sounds like it’ll infect the release branch with less stable code. And now I’m all confused and don’t know what to do.

So I’d like to ask others how they deal with this problem. How do you setup you engine repo for using in a game? How do you keep it up to date with the latest Epic code? And what do you do to get it ready for a release?

Also when do Epic pull code into the release branch, and from where do they pull from?

Thanks for any help!

You might want to stick with release branch for your game, and make the modification base on the release branch. For example:

git fetch upstream && git checkout your-4.8-game-dev-branch && git rebase upstream/4.8

But if for some reason you want to work on latest master branch and would like to port the changes to release branch, you can cherry-pick your commits over, like:

git checkout upstream/4.8 && git checkout -b your-4.8-game-release-branch && git cherry-pick commits-from-master-branch

Will that pull the changes unique to that commit as opposed to all the changes up until that commit? That’s quite cool. Although looking at the commit messages it might be quite hard to tell what commit has something I’d want.

You can do both. E.g.

git cherry-pick 0a4fba2

will pick up change in commit 0a4fba2

git cherry-pick 0a4fba2~1..cf2834d

will pick up changes from 0a4fba2 to cf2834d

Yo can read more about “git cherry-pick” command here.