Icon

How to Use an Old Working Commit When Main Blocks Level Design

When main is broken (eg. play test scene has a bug) and will take some time to recover. We have the option to use an older working commit to unblock yourself and test levels . This guide covers how to navigate to an old commit, create a new branch, make changes, stash those changes, and commit those changes to main branch.

By Xueer Zhu

Leveraging a Working Commit for Progress

When encountering roadblocks on the main branch, accessing a reliable commit from your project's history can provide a clear path forward.

Creating new branch from a working Commit and Testing New Content

Stashing Changes and Committing

After successfully crafting and validating your new content within the safe confines of your working commit, we'll guide you on how to stash these changes for future use. You'll learn how to seamlessly transition back to the main branch, apply your stashed modifications, commit your updates, and push them to your repository.

Let's get started.

We will navigate to the Fast Block Client, Main branch page, and then select Commits.

1

In this case, I have found out that the last working commit is the one with the message "More island 8 levels". I'm going to copy this commit's hash.

2
3
Click icon to copy SHA for this commit

4
Go to Tower app, click "Quick Action" button on top bar
5
Paste in copied SHA. Click "Create new Branch"

So, now your HEAD should be on that branch you just created.

6

Let's go to Unity, refresh "ctrl + R" inside of the Editor.

Create the changes you want. For example, I created a "NewLevelTest"

7

When I am ready to commit those changes. I go back to the tower.

8
Click "Working Copy"

Find and select the NewLevelTest changes I added.

9
Select changed meaningful files
10
Right click and select "Stash 2 items"
11
Enter some message for your reference and Click "Save Stash"
12
Switch back to main

After I'm in the main branch, I can return to my stash and apply the stash I just saved.

13
Click "Apply Stash " on the stash named "new levels created "
14
Confirm "Apply Stash"

If I go to my Working Copy on my current main branch, I see the level changes I created. And I can commit or push from here as I would normally.

15