Why use Github for an Unreal Engine project and how to do it.

A long time ago, or a while ago, I made a video about how you can use the combination of Git and GitHub or similar plus a project in Unreal Engine and talk to you a little about the importance of the same and on this occasion, I'm going to make a shortened version of the previous video.

Why use Git + GitHub in Unreal/Unity

If you're developing here in Unreal or any other type of game engine like Unity, it's important to do this for basically two reasons. There are several more, but these are the two main ones for me:

Code Backup

One is backing up your code. That is, if your computer crashes or anything, you can easily access that project. You won't lose anything.

Problem Prevention and Easy Restoration

The next thing is that a problem often arises when making any type of configuration at the project level, and the project crashes. Then, you have to modify it manually, potentially wasting days. So, with this, you save all of that because you simply have to download it, since the version that's, so to speak, on GitHub is supposed to work. And if it doesn't work, you can simply do a... you can easily revert to a stable version.

With commits, you can easily revert to an older version that was a stable version. So, you gain two things: on the one hand, you can protect your code; on the other hand, if any problem arises, you already have it, so to speak, you don't have to deal with that "bastard." So, those are the two main features for me.

Additional Benefit: Multi-Computer Synchronization

And a third benefit that comes free is that, if you're like me and work on multiple computers (in this case, I use three), you can easily synchronize them on any of the three without any problems.

First Steps: Project Created in Unreal

So, those are the advantages. The next step is what we need to do to use this. Obviously, you have to have your project created in Unreal. I'll take that for granted. We're now on to the second point.

GitHub and git

Step 1: Create a GitHub Account

The next step is to go to this page called GitHub, which is where your project will be stored remotely. It's completely secure, don't worry about that. There are many similar pages, such as GitLab, but this is the most commonly used one, the one I would recommend, although you're free to explore the rest of the options. Here's the normal procedure: I already have an account, but you register, log in, or create an account, and that's about it. Then, you'll create the repository for your project. You can set it to private if you wish.

Step 2: Verify or Install Git on Your Mac

How to install Git: If you're on a Mac, you may already have it there. You just have to type git in the terminal and that's about it. Likewise, we'll look at some commands right now, but again, I'll take the configuration part for granted.

Initialize project in Unreal

In this case, I'm going to show you a little video to make it a little clearer. So, here I created the project and the whole thing.

The first thing we have to do, and the only thing we have to do, is here, in the corner where it says "Revision Control," add the Git repository, and that's it.

The next step is to close the project in Unreal and cd to the project location.

And the necessary commands.

get status 

To see the changes made.

git add.
git commit -m “”

To add the changes:

git push

To sync changes, remember to add the remote as shown in the video so you can add the changes to the GitHub repo.

Key points

Files must not be larger than 100 MB; in fact, files larger than 50 MB will trigger an alert.

I agree to receive announcements of interest about this Blog.

We talk about why and how to use Git and GitHub in your Unreal project.

- Andrés Cruz

En español