By Zac Jackson
Working with a team to make your project come to life? Source control allows you to make an online version of your project so that if anything happens to the content on your PC, you can always get the most up-to-date files that work in only a few simple steps. This makes Source control useful for solo developers as well.
What is a Pull Request?
Before we get into the tutorial, let’s discuss Pull Requests. A Pull Request is when someone has a fork of your project (basically a copy of it on their account) and they would like to add some of their project to yours. This becomes incredibly useful for when you have multiple team members working on the game and adding things like textures or source code from different computers.
We are going to be using GitHub for these Pull Requests. Pull Requests need to be accepted by the project owner, so don’t worry about someone adding something that you didn’t want.
- Unreal 4
- Some knowledge of Unreal 4’s user interface
- Git Installed (download link)
- Little knowledge of GitHub (Basically what we covered above)
Step 1: Navigate to GitHub’s Website and create an account. GitHub is free for public repositories, but only 7$ a month if you’d like to keep your project private (recommended). Skip this step if you already have an account set up.
Step 2: Once you’ve made an account, Download GitHubs desktop application and install it. Once installed, login to the app, you should see this window:
Step 3: Next we need to create a repository. Click “Create new repository” on the left. It will ask you to name it, as well as give it a description. I chose to create this repo for Origin Story, so I named it after that. GitHub will automatically want to create a folder named GitHub in the documents folder of your computer, for this example, I made a folder on my external drive.
Once you’ve chosen what you’d like to do, click “Create Repository”.
Step 4: You should now see the window below. Next click on “Open this repository in explorer”. Once there, drag and drop your project files into this folder.
NOTE: Make a copy of your game first if you can and drag and drop that. Always play it safe and back everything up, especially when moving files.
Once you’ve moved the files, they should start to populate in the GitHub app.
Step 5: Once the files have completed moving, we can commit. A commit is a way of saying why certain files were created or what you obtained in a commit. For example, “added houses” would tell us that in that commit, we added houses.
To do this, you can click “Commit to Master” at the bottom left of the window. Remember to name and leave a description for the commit first.
NOTE: We can also create a branch and commit changes to a branch instead of the master as well.
Step 6: Now what we’ve done basically is create a “local commit”. This means our changes only affect local files and does nothing to the online version. To update the online version as well, click on “Publish Repository” at the top right of the window.
NOTE: You can choose whether the repo is public or private if you have the upgraded github account. Remember, public means that anyone can access your code and private means that only people you add to the repo can access it. After that, you can click publish.
Now all of our files are safely backed up on the cloud.
Step 7: Next, we can connect the GitHub repository to Unreal 4. To do this, open your project in the Unreal 4 engine. Remember to open the project up from the Git folder you made for the repository. Once its open, click on the “Source Control” button at the top of the screen. It will drop down a menu, click on “Connect to Source Control”
Step 8: You should now see the Source Control Login window. Choose Git(beta) from the provider menu. If you have Git installed, it should automatically find the git path. Once this is done, click “Accept Settings”. Your project is officially connected to GitHub!
If you make any changes to your project, you can click on the “Source Control” button at the top of the Unreal 4 window and then select “Submit to Source Control“ from the drop-down menu. Go through the next window’s instructions, it basically just asks you to comment on the commit before sending it to GitHub. You should now see the commit populate in the GitHub App!
Git and GitHub have an incredible amount of supporting information and tutorials for all of your needs for team collaboration.