Skip to main content

Git Sync

Learn how to handle Git sync messages in your Coalesce App.

Unable to Update Branch out of Sync

This error is usually caused by changes being made off platform. To prevent sync errors, we recommend periodically updating your local copy by:

  • Always checking out the latest version of a branch to work from.
  • Periodically fetching the repo.
  • Doing frequent commits.

You can solve it by either discarding your changes or creating a new branch to keep your work.

Shows a Branch out of Sync error in a Git-based workspace. The user is notified that their current branch isn't synced with the most recent changes, preventing updates until uncommitted changes are resolved or discarded.

Discard All Changes and Update

This will delete any changes you’ve worked on and update your branch to match remote.

Create a New Branch To Keep Work

You can create a new branch to hold your changes, then merge the new branch into the synced branch.

Let’s review the example, you’ll be walking through. You made a change locally, in this case, the description of the node CUSTOMER_VIEW was changed to Coalesce App. The remote has the same node, but the description was changed to GitHub description. In the app, the branch is called main.

On one side are the node properties in Coalesce showing the description as Coalesce App Customer Node. The other side is the same node in GitHub with the description as GitHub description change.

Step 1: Create a New Branch

If you try to merge these changes, you’ll get the error message: Unable to Update Branch out of Sync.

  1. While in the modal, click the Branches tab. The Unable to Update Branch out of Sync will disappear and you’ll be on the Branches tab.

    Shows a Branch out of Sync error in a Git-based workspace. The user is notified that their current branch isn't synced with the most recent changes, preventing updates until uncommitted changes are resolved or discarded. There is a arrow pointing to Branches
  2. Create a new branch from the commit you are working on. In this example, the commit is GitHub Customer View Node Desc Change. The new branch in this example is named save_uncommited_changes.

    The diagram depicts a Git branching scenario with two branches: 'main' and 'save uncommitted changes'. The 'main' branch is shown as 'out of sync', indicating a divergence from the current workspace state. By creating a new branch from 'main' and naming it 'save uncommitted changes', one effectively captures the current code state in a distinct branch. This new branch will then encompass all uncommitted changes, preserving the original code state.
  3. You’ll get a new message that says: The branch save_uncommited_changes that's attached to this workspace is out of sync. Certain actions are unavailable until the current branch is synced with the latest version. Go to the Commit tab to sync the branch.

  4. Click on the Commit tab. The branch is now save_uncommited_changes. You have a new message advising your branch is out of sync. Click Update Branch.

    Branch out of Sync error in the Git workspace, with an option to update the branch and synchronize local changes with the latest branch updates

Step 2: Commit Your New Branch

  1. After creating a new branch to save your changes and then updating, now you’ll commit your changes.

  2. Still on the Commit tab, review your changes and commit. In this example, you can see that the description that was changed locally is being committed to the new branch save_uncommited_changes. The commit message is changed description.

    The image displays a code diff within a user interface. The code diff is a visual representation of the alterations to a yaml file, with a focus on the description field. The description has been updated from GitHub description change to Coalesce App.
  3. Go back to the Branches tab and switch to the main branch. Click Check Out Latest. This will pull the changes from the remote main to your local main branch.

  4. Refresh your page. This is important to make sure that the changes from main are applied in the Coalesce app. Your changes are still saved on the new branch you created. Review the changes to be sure. You are looking for the description from main, in this example it’s GitHub description.

Don’t Forget To Refresh

You need to refresh to make sure the changes from main are applied correctly.

Step 3: Merge Your Branch

The branch that holds the uncommitted changes needs to be merged into main. In this example it’s save_commited_changes.

  1. Go back to the Branches tab and switch to the main branch if you already aren’t on main.

  2. In the dropdown select the save_uncommited_changes branch.

  3. Select Merge next to your commit that saved the change. In this example, it was changed description.

    A depiction of a Git branch merge interface, displaying the integration of modifications from the save uncommitted changes branch into the main branch.
  4. If you only had a few changes, then you’ll be presented with a Merge Conflict screen. Accept your changes. In this example, click Accept Incoming to accept the description change to the node. We are using Accept Incoming because the branch we saved the changes to is incoming to the main branch. If you have too many conflicts, you’ll need to resolve them outside of Coalesce. Review our Merge Conflicts documentation.

    A merge conflict in a YAML file named WORK-CUSTOMER_VIEW.yml. The user is presented with options to either keep current changes or accept incoming changes to resolve the conflict
  5. Your saved changes were merged into main. Refresh the app to see your changes.

Branch Out of Sync

This can happen if changes were made to the branch outside of Coalesce. Update the branch with the remote changes. If it can’t update, you’ll be able to pick the changes to keep using the Merge Conflicts processes.

Branch out of Sync error in the Git workspace, with an option to update the branch and synchronize local changes with the latest branch updates

Video Resolving Git Sync Errors in Coalesce