Updating to the Latest Changes from Epic

Describes how to update your fork of the Unreal Engine source code to get the latest fixes and new features.

Choose your operating system:

Windows

macOS

Linux

One of the biggest benefits of working from source is that you always have access to the very latest improvements and new features that our team adds to Unreal Engine. As we make changes in the source code and issue new official releases, we continuously update the various branches of the Unreal Engine GitHub repository . You'll probably want to pick up these changes periodically: perhaps every time we publish a new official release, every month, or even every day.

This page describes two different approaches you can use to update a branch of your fork so that it matches the latest changes in the main Unreal Engine repository.

Option 1: Using an Upstream Remote

In this approach, you add the original Epic Games Unreal Engine repository to your local copy of your fork as a new remote repository. This is usually referred to as the upstream remote. You pull changes from that upstream remote into your local branch. Then you can push those changes back up to your own fork on GitHub (usually referred to as the origin remote).

Although this may at first seem trickier than using a GitHub pull request as described in Option 2 below, we recommend this approach. It has a couple of advantages:

  • Once you've set up your upstream remote, you never have to set it up again as long as you keep using the same local clone of your fork. This makes it very quick and easy to pick up new changes as frequently as you feel is necessary for your project.

  • Each time you use a GitHub pull request to update your fork, you create a new commit in your branch and a new pull request in your project's history. This is usually harmless, but it's better to avoid these unnecessary entries.

The instructions below show how to use the Git command-line tools to add the new remote and pick up changes. If you use a visual Git client, the steps should be roughly the same. See your tool's documentation for details.

If you use GitHub Desktop , the upstream remote is automatically created for you when you clone your fork. You only need to merge the changes from the upstream branch into your local branch, then push those changes up to your origin repository.

To set up the upstream remote:

  1. If you haven't already done so, clone your fork to your computer.

  2. Open a command prompt, and navigate to the folder that contains your repository.

  3. Add the base Epic Games repository as a new remote, named "upstream".

    > git remote add upstream https://github.com/EpicGames/UnrealEngine

To bring the changes from the upstream remote into your fork:

  1. Checkout the branch you want to update. For example:

    > git checkout master
  1. Pull the changes from the upstream remote into your local branch.

    > git fetch upstream
    > git merge upstream/master
  1. Push the changes up to your origin remote.

    > git push origin master

Option 2: Using a GitHub Pull Request

  1. In a web browser, go to your repository's home page on github.com .
    This typically follows the format https://github.com/<username>/UnrealEngine , where <username> is your GitHub user name.

  2. Choose the branch you want to update from the Branch widget.
    Selecting the master branch

  3. Click the Compare link.
    Compare

  4. Typically, as long as you haven't made changes to this branch in your fork, GitHub will tell you that the Epic Games repository already has all the commits from your repository.
    Click the link for switching the base , which reverses the comparison and shows the commits that have been made in the engine repository but that are not in your fork.
    Switching the base

  5. Take a quick look at the list of changes. If the dates shown match what you're expecting, click Create Pull Request .
    Comparing changes between branches

  6. Enter a brief description to indicate what branch your pull request is updating. When you're done, click Create Pull Request .
    Open a new pull request

  7. GitHub shows the Conversation tab of your new pull request. At the bottom of the list of changes, click Merge Pull Request .
    Merge pull request

  8. Click Confirm Merge .
    Confirm merge

When the merge is done, your fork's branch will be up-to-date on GitHub. You can now use the Git command line or your choice of visual tools to checkout the branch and pull the latest changes to your local computer.

Option 3: Using Perforce

Stream Workflow

The following flowchart illustrates the flow of Engine code and content through the various types of Perforce streams during development and leading into release:

PerforceStreams.png

Integrating, Merging, and Branching

During a game's production cycle, your team may decide to periodically update the project to newer versions of the engine that might include new features or bug fixes. The process for getting an updated build from Perforce is the same as the one you use for the initial sync. However, there is a lot to consider as far as how you maintain the engine on your own Perforce server and how that affects your ability to integrate and merge new builds into your code base while minimizing conflicts.

Merge and Integrate

We recommend a branch hierarchy similar to this:

Branch

Description

//depot/Epic

Contains a pristine copy of Epic's codebase, with no modifications.

//depot/MergeTest

Staging area for merging Epic changes with your own engine changes.

//depot/Dev

After merging the engine release build with your code base and passing integration tests, this is the development tree that you will work from.

Upgrade to a New Engine Release

After getting Perforce access from our support team, you can get the contents of an Engine Release build from Epic, and a good way to get a new build is to:

  1. Sync a copy of the latest Engine release from Epic's Perforce server.

  2. Sync a copy of the //depot/Epic branch from your own Perforce server.

  3. Delete the files from your local //depot/Epic workspace, and copy over the files from the new engine release.

  4. Make a changelist (CL) representing Epic's updates by using P4V's Reconcile Offline Work feature.

  5. After completing your reconcile operations, go ahead and check-in the CL you just made.

    At this point, the Epic branch is a copy of the Engine Release build, which includes integration history, giving the merge tool change information that helps you reduce conflicts while merging and integrating the latest engine updates into your code base.

  6. Merge your latest development branch ( //depot/Dev ) into the merge/test branch ( //depot/MergeTest ).

  7. Merge the latest engine release into the merge/test branch ( //depot/MergeTest ), and test the changes.

  8. Merge the updated version of your game from the merge/test branch ( //depot/MergeTest ) into the development branch ( //depot/Dev ).

Here is a diagram showing the expected flow of changes between branches as new engine versions are released:

Perforce_IntegratingMergingBranching.png

The more frequently you update, the less likely you are to run into serious conflicts when merging.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss