Skip to content

How to backup and maintain your project using GitHub and GitHub Desktop

During game development, there are usually hundreds of changes from the beginning to the end of the project. There may be times when the developer needs to move back to an earlier version of the game or project. Without continual backups, this means manually undoing all of the work done days before, which can create other accidental errors. GitHub provides a way to host the game project files, as well as complete Version Control for the game as development continues.

Requirements

To complete this process, the following requirements must be met:

Step 1 - Set Up a GitHub Repository

The following should be completed before creating the game project in GDevelop. If the game project has already been created, there are some additional steps to complete at the bottom of Step 2.

  1. Launch GitHub Desktop.
  2. Click the File menu.
  3. Click New Repository....
  4. Within the Name field, type the desired name of the repository, without spaces.
    • e.g. If the game is named My Game, the repository should be named My-Game. If you don't remove the spaces, GitHub will do this for you, so make sure to pay attention to the repository name.
  5. Within the Description field, type a short description of your game.
  6. Within the Local path field, type or browse to the parent directory of where you want your repository stored.
    • e.g. If the final repository location should be D:\My Documents\My-Game \ browse to D:\My Documents\ only
  7. Leave all other settings as default.
  8. Click Create repository. The local copy of the repository will be created and the screen will refresh.
  9. Click the blue Publish repository button towards the upper right.
  10. Ensure the Name and Description fields have the appropriate information.
  11. If the repository should not be available to the public, make sure the Keep this code private box is checked. Your repository will be published to the Github site.

Step 2 - Create your Initial Commit

For new Game Projects

  1. Within the GDevelop start page, click CREATE A BLANK PROJECT.
  2. Within the new window, populate the PROJECT NAME field with the desired project name.
  3. Click CHOOSE FOLDER. The Choose a folder for the new game window will appear.
  4. Browse to the repository directory.
  5. Click Select Folder. The game project path will update.
  6. Click the desired example or Empty game. The game project will be created.
  7. Make any initial changes.
    • It is strongly recommended to use Multiple File mode within the Game Settings > Properties window. This ensures that each scene and external event can be tracked separately.
  8. Click the File menu.
  9. Click Save.
  10. Within Github Desktop, the list of files on the left should update to show all of the project files.
  11. Within the Summary field on the lower left, type initial commit.
  12. Click commit to master. The files will disappear and the screen will update.
  13. Click the blue Push origin button near the upper right. The initial commit of the game project is now completed.

For existing Game Projects

  1. Within GDevelop, ensure the game project is currently open.
    • It is strongly recommended to use Multiple File mode within the Game Settings > Properties window. This ensures that each scene and external event can be tracked separately.
  2. Click the File menu.
  3. Click Save As.... The Save As window will display.
  4. Browse to the repository directory.
  5. Click Save. The project files will be saved to this folder, and the original project location should no longer be used.
  6. Within Github Desktop, the list of files on the left should update to show all of the project files.
  7. Within the Summary field on the lower left, type initial commit.
  8. Click commit to master. The files will disappear and the screen will update.
  9. Click the blue Push origin button near the upper right. The initial commit of the game project is now completed.

Step 3 - Create the first branch

  1. Within GitHub Desktop, click the Current branch drop down.
  2. Click New Branch. The Create a branch window will display.
  3. Type the name for the branch. Commonly this will be the name of a feature or function currently being worked on.
    • e.g. If working on level graphics, consider naming each separate branch for the level currently being worked on such as Level-1. Remember, spaces in GitHub names aren't allowed. If a space is used, GitHub will automatically replace it with a hyphen.
  4. Click Create branch. The screen will update.
  5. Click the blue Publish branch button. The branch will be created on Github.
  6. Ensure that the Current branch dropdown now shows the newly created branch.
  7. Begin making changes to the game in GDevelop.
  8. After saving in GDevelop, consider making an initial commit to this branch similar to Step 2 above.
  9. Going forward, after making large changes related to this branch, make sure to commit the changes to the branch within Github Desktop.

Step 4 - Additional processes

  1. Once the focus of the branch is completed, a pull request must be created to merge all of the changes. Follow the process here to create the pull request.
  2. After the pull request is created, it must be merged to the master branch. Follow this process to merge the pull request on the GitHub website.
  3. Going forward, new branches should be created as the game project moves on to each new feature or bugfix. Because Github allows for restoring the game code only to different commits, commits to branches should be completed frequently. Here are some examples of how frequently commits are completed in just one day, along with descriptions to easily identify what is changed:
  4. If changes are ever completed in error, GitHub and GitHub desktop allows to restore from the change history.Complete this process if a restore is needed.