obsidian-git
obsidian-git copied to clipboard
[Bug]: Merge Conflicts not supported on mobile?
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
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?
I'm seeing this error as well and I'm not sure what to do
Sorry, but I can't reproduce. Are you sure you have the same root history? So the histories are not completely divergent?
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
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. :)
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."
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".
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.
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.
One workaround is as follows:
- download iSH on the App Store (or other terminal emulators).
-
apk add git
-
mkdir -p /mnt/Obsidian
-
mount -t ios null /mnt/Obsidian
then a popup will show, add the Obsidian vault location. - perform other git commands like reset, or try to resolve merge conflicts
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.
I have the same issue regularly, but here's how I solve it:
- On your mobile device, commit all changes to
main
. - Create a branch called
mobile
and switch to it. - 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 namemobile
. - On your mobile device, push the
mobile
branch to get the current vault's state on the remote. - On your other device, rebase the conflicting
main
ontomobile
, resolve any conflicts, and then fast-forwardmobile
to the newmain
. - On your mobile device, switch to
main
and pull the updated, resolvedmain
. You now have resolved the conflict and both devices share the samemain
state. - (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! 🚀
Thanks @sammorley-short! This work-around worked for me.