Lost all changes when synchronizing

I was going to commit my changes to the project and the synchronize progress failed, I got some error message saying it could not update the current branch. This reverted all the changes to all files I had worked with.

If you can find a repro-case, please report it immediately.

I have had this happen to me and my team several times as well. The error says “Unable to update local branch” and every change is then reverted. This seems to happen sometimes if someone else have pushed up changes while you where working.
It is possible to save some work if you had the files in question open in the editor by pressing ctrl+z.

That sounds like a serious issue. Can you please check the error log (tab beside the Console in the editor) and see if you can find something at the time of this error? If so, please send the content of the log.

Also, what platform(s) are you working on?

The error log does not show anything from today.
We are working on windows 8.

Hmmm… Do you have non-ascii characters in any of your filenames (like åäöÅÄÖ)?

No, i doubt it have something to do with the contents of the commit since we can remake the same changes and then commit just fine. It might be a coincidence but it seems to happen more frequent if uncommitted changes are left from another day.
My guess is that it has something to do with write access to the folders or something similar.

The reason I’m asking is that I just tried working on a file with weird characters and got the same error message. The editor has some problems if you have files with spaces or non ascii characters so we recommend against it.

The editor has very simple Git control functions and you can use Git command line or an external tool if you want. The editor does a local commit before it tries to pull changes into the current branch. You should be able to find all your lost commits in Git, but it requires some digging.

One of my colleagues got the “Unable to update branch” error again, it occurred before the prompt for a commit message. We opened the git repository in a external git client (Sourcetree) but it shows no signs of making a commit to a local branch.

We might have found the issue. We had a folder with a space in the name, every time a file in this folder was changed and committed it caused problems when other people tried to sync. Hopefully this is the last i will see of this error. So many hours of work lost to a single space. :frowning:

Thanks a lot for this report! We’ll dig into this issue further.

If you get errors before the commit, that’s really bad. If the commit happens, you should find it. However, the ordinary Git log might not show it. Check out the internal Git log for the objects. Don’t know how “Sourcetree” does that but from command line (and project root) you can type “git log --reflog” and get a list of the full local history with all committed objects.

I had the same problem.
Me and my friend were synchronized to the same revision.
My friend have added some directories, assets and modified main collection.
I’ve added some directories (possibly with the same name as my friend), added some scripts and modified main collection.
My fiend synchronized. He is using Mac, so his line endings are \n
I’ve tried to synchronize. I’m using Windows, so my line endings are \r\n.

Our paths and file names didn’t contained spaces nor diacritics. Our file contents didn’t contained diacritics.

During my synchronization I had an information that synchronization failed and I’ve lost all my changes.

“git log --reflog” shown only successfull commits - no info about my changes there.

Ouch, I’m sorry to hear that. For more advanced use-cases or for many developers collaborating on a single code base I can very much recommend to switch to either the git command line or to an external git tool. That way you can work with branches and deal with merging and conflicts in a much better way. I find that when working in a team the built in sync tool in Defold works well enough for artists modifying and adding assets, but when it comes to control over your code an external tool is better and more powerful.

This just happened to me on 1.2.96 and I lost the bulk of what I’ve worked on for the past day and a half. Like @Pavulon, my last commit was also from OSX, but the event occurred on Windows 10. Nothing relevant in the Defold error log, and nothing in the git reflog. As far as I can tell, no amount of git magic will bring it back…so looks like I’ll be gitting manually from now on :unamused:

Ow ow ow! And you’re sure the changes aren’t stashed or something?

yeah, empty stash :frowning: I got some error about not being able to update the branch, and poof everything was back to HEAD. FWIW, if it’s any use in fixing this issue, I actually had clicked synchronize at least once already and was in the process of reviewing the diffs and cleaning up when a subsequent synchronization triggered this error. At first I thought I had just been kicked to another branch, so I went to checkout the branch I was working on again, hoping/figuring the changes would still be there, and I think this exception in the log is probably from that (it popped an error dialog and wouldn’t let me open the branch):

java.lang.NullPointerException
at com.dynamo.cr.sceneed.core.SceneModel.dispose(SceneModel.java:167)
at com.dynamo.cr.sceneed.ui.SceneEditor.partClosed(SceneEditor.java:491)
at org.eclipse.ui.internal.PartListenerList$3.run(PartListenerList.java:102)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.PartListenerList.fireEvent(PartListenerList.java:57)
at org.eclipse.ui.internal.PartListenerList.firePartClosed(PartListenerList.java:100)
at org.eclipse.ui.internal.PartService.firePartClosed(PartService.java:223)
at org.eclipse.ui.internal.WorkbenchPagePartList.firePartClosed(WorkbenchPagePartList.java:39)
at org.eclipse.ui.internal.PartList.partClosed(PartList.java:274)
at org.eclipse.ui.internal.PartList.removePart(PartList.java:186)
at org.eclipse.ui.internal.WorkbenchPage.disposePart(WorkbenchPage.java:1809)
at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1514)
at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1498)
at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1472)
at org.eclipse.ui.internal.WorkbenchPage.closeAllEditors(WorkbenchPage.java:1275)
at com.dynamo.cr.editor.wizards.ConnectionWizardBranchPagePresenter.finish(ConnectionWizardBranchPagePresenter.java:154)
at com.dynamo.cr.editor.wizards.ConnectionWizard.performFinish(ConnectionWizard.java:47)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:827)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:432)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at com.dynamo.cr.editor.handlers.ConnectHandler.execute(ConnectHandler.java:31)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:499)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at com.dynamo.cr.editor.Application.start(Application.java:42)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

I was able to open the branch again after restarting the editor, but alas, no changed files.

For super need to never lose work paranoia, setup an automatic backup service for your Defold project folder. I use crashplan but there are other free services which can make versioned automated backups to separate folders / harddrives / online.

This has happened to me three times now, where the editor reverts all my changes when it fails to sync. Lost hours of work several times over.

Is there any reason at all why it has to revert everything just because of a failed sync?

1 Like

Which editor are you using? And on what platform?
The procedure for the editor is to stash your changes, and then pull changes, then reapply your local changes.
If you check your git stash, is it empty? E.g. run “git stash list” from your command prompt.

Before push process Editor make git stash command. If you see what you changes disappear. For return you changes install git for you system and make next command.

  1. Install git and run git console(for windows) or open terminal for macOS/Linux
  2. Goto to project folder
  3. Make command git stash list and you see stashed diffs in repo
  4. Make command git stash apply and you apply last stash
  5. Enjoy - all you changes returned.
1 Like