obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: Merge Conflicts not supported on mobile?

Open tjcampanella opened this issue 2 years ago • 13 comments

Describe the bug

When attempting to pull on Obsidian mobile I get an error saying "MergeNotSupportedError: Merge with conflicts is not supported yet". I am unsure if this is a bug or it is just not supported yet like the message says. I saw an issue saying that merges should work on the Obsidian Git Mobile issue. If it is not supported then please let me know how I should handle this. Thanks.

Relevant errors (if available)

No response

Steps to reproduce

I have automatic pull enabled so when I startup Obsidian it attempts to pull down the changes however, it fails with a MergeNotSupportedError. I am unsure exactly what I did to cause this I assume I made some changes on my phone without syncing with my computer so things must have gotten out of sync.

Expected Behavior

No response

Addition context

No response

Operating system

iOS

Plugin version

2.6.0

tjcampanella avatar Oct 16 '22 16:10 tjcampanella

I have the same problem: I've got conflict on mobile and now can't make pull and as I right understand there are not in mobile ways to resolve conflicts :( At least it would be enough to have ability to open conflict file for manual conflict resolving.

@Vinzent03 you had discussion about conflicts in mobile version here Maybe our case helps you to resolve problem?

glassoff avatar Oct 25 '22 16:10 glassoff

I'm seeing this error as well and I'm not sure what to do

thebrianbug avatar Nov 12 '22 20:11 thebrianbug

Sorry, but I can't reproduce. Are you sure you have the same root history? So the histories are not completely divergent?

Vinzent03 avatar Nov 12 '22 23:11 Vinzent03

Ah, I see that I had the merge strategy set to rebase for my desktop and merge on my phone. Git has problems when trying to mix strategies. Trying both to "merge" to see if that's better

thebrianbug avatar Nov 14 '22 14:11 thebrianbug

I was having the same issue with a fresh git install that I did in a new laptop. With my old laptop I had no issue to sync the mobile.
I reinstalled git and pushed a new file to the repository with plain git and the mobile synced fine. Then I installed obsidian-git and it started to work. :)

J-Emmerich avatar Nov 15 '22 18:11 J-Emmerich

I have the same error. Laptop and iOS have merge strategy.

After trying "pull" I have message "MergeNotSupportedError" After trying "push" I have message "PushRejectedError: Push rejected because it was not a simple fast-forward. Use, "force: true" to override."

RedHotUnicorn avatar Nov 17 '22 06:11 RedHotUnicorn

I also have the same problem: I made the changes on my laptop yesterday and opened Obsidian on my mobile today. Seems like Obsidian ignored my changes on my laptop and simply pushed back to remote (wasn't a force push because the files I added on the laptop were shown as deleted). I tried to force push from my laptop, and voila: now when I open my phone I get a "MergeNotSupportedError".

nirmalhk7 avatar Jan 18 '23 14:01 nirmalhk7

same problem on my Android phone. push: buffer error pull: MergeNotSupportedError. Anyway, I solved it through re-cloning the whole repo and restricting my operation on different divices.

Chiaoso avatar Jan 22 '23 12:01 Chiaoso

Following this as well, is there no way to resolve merge conflicts on mobile? I suppose that adding a sort of git reset --hard command to mobile would solve many problems.

freeman-jiang avatar Jan 29 '23 13:01 freeman-jiang

One workaround is as follows:

  1. download iSH on the App Store (or other terminal emulators).
  2. apk add git
  3. mkdir -p /mnt/Obsidian
  4. mount -t ios null /mnt/Obsidian then a popup will show, add the Obsidian vault location.
  5. perform other git commands like reset, or try to resolve merge conflicts

Resources: link link2

Apps like Working Copy might work where you can add local repos, but I think it's a premium feature.

Not sure if like merge commits or rebases have caused pulling to stop working on my iPad, I remember seeing sth like only fast forwarding is recommended or sth.

sickerin avatar Feb 19 '23 03:02 sickerin

I have the same issue regularly, but here's how I solve it:

  1. On your mobile device, commit all changes to main.
  2. Create a branch called mobile and switch to it.
  3. On a non-mobile device running the same git repo, create a branch called mobile at the first commit of the repo, then push it to the remote (with branch name mobile.
  4. On your mobile device, push the mobile branch to get the current vault's state on the remote.
  5. On your other device, rebase the conflicting main onto mobile, resolve any conflicts, and then fast-forward mobile to the new main.
  6. On your mobile device, switch to main and pull the updated, resolved main. You now have resolved the conflict and both devices share the same main state.
  7. (Optional) delete the mobile branches on both devices and the remote.

(7 is optional because I have found it useful to maintain the mobile branch as a record of the last guaranteed point of agreement across clients, which means you don't have to reset to the initial commit if you need to repeat this process in the future.)

Hope this helps, good luck out there, and remember: commit early and often! 🚀

sammorley-short avatar Feb 19 '23 16:02 sammorley-short

Thanks @sammorley-short! This work-around worked for me.

stevector avatar Feb 23 '23 22:02 stevector