[Mobile] Setting up iOS git-based syncing with mobile app (using Working Copy)

Update: when I tried to ‘stop syncing and remove history’, I get an error “{guid}_config” couldn’t be moved to “.obsidian” because either the former doesn’t exist, or the folder containing the latter doesn’t exist..

I had changed the obsidian config filename to .obsidian.mobile before syncing the folders.

I deleted the repo, but not the vault, then cloned the repo & synced it with the obsidian folder again. Still had issues with that one Cyrillic file, but I reverted its deletion in WorkingCopy and it seems that things are all ok now.

edit:
I see that the new release of Working Copy says that it ‘fixes problems with Folder Sync when filenames contained diacritics.’

Seems quite likely that the folder sync issue I had may have been to do with that, still not entirely sure how much that had to with my other more serious problem, but it’s all been working fine after the first bit of faffing.

Amazing, thank you!! This does exactly what I wanted!

Thank you very much for this explanation. It works very well for me. I just include all my big files in my .gitignore file and periodically clone my assets folder path across from my cloud storage to my iPad locally. Because the paths to my backlinks are identical by merely copying the assets folder across, all my links and embeds of the bigger files seem to work fine.

I could probably create some IOS shortcuts to possibly automate this process more, however for my use case this seems like the most simple way of getting around the storage limitations of git and Working Copy.

This helped a ton! Thanks so much. I found this to be really helpful particularly coz my iCloud would not sync onto my phone >…< from my mac.

I think this approach works really well with the Obsidian Git plugin :slight_smile:

Working copy does require $20+ USD to purchase ability to push commits but if you are a student then there is the GitHub student pack which lets you access pro features for free.

So far I am using iOS shortcuts to sync before and after I open obsidian app.

Ok here are a few tips after following OP’s suggestions. I use:

  • macOS on my laptop
  • obsidian-git plugin (desktop only as of August 2, 2021).
  • Obsidian mobile on iOS
  • Working Copy (App Store download on iOS with $20 lifetime upgrade which allows push capabilities

Depending on your workspace needs, and assuming you have 1 mobile, and 1 desktop device, and you use it yourself only. Due to the .obsidian/workspace file getting changes always, I suggest one of the following options:

1. You want a separate workspace for mobile and desktop versions:

As OP said, create a separate .obsidian.mobile folder for mobile. Once synced, duplicate your original .obsidian folder and rename it .obsidian.mobile. This way, at least from the get-go, you will have the same plugins, settings, themes, etc, and you can customize from there, as opposed to redownloading everything and setting everything up from default Obsidian.

2. You want the same workspace

Just use the .obsidian folder for both.

But for both options:

If you don’t already, add a .gitignore file in your root directory where you initiated your git project. If you’re like me, you just commit ALL changes, push them, and who cares about the message.

Note for people who don’t know why you probably don’t care about workspace changes: A workspace is just a file that has info on where your panels are, a bit of history on last files opened, what file you’re on, etc. This file gets updated with nearly every mouse click and keyboard stroke. This means if you don’t add this file to gitignore, you git repo will have potentially commits every few minutes you use your device.

The first time you get everything synced up, just git add .. This adds all files to git to be tracked. Once you got everything working, able to commit/push/pull/merge on both of your devices, you need to remove workspace from git.

  1. Either git rm --cached .obsidian.mobile/workspace && git rm --cached .obsidian/workspace or git rm --cached .obsidian/workspace from terminal.
  2. Now open that .gitignore file you created earlier and add one line that looks like .obsidian*/workspace. This works whether you are tracking changes within one workspace, or two.

Now you don’t need to worry about workspace conflicts between devices, or syncing when all that has changed is workspace data.

Note Even if you keep two distinctly separate workspace files, I still think you should .gitignore them. This is because yes, you won’t have a single file being updated from two different devices, but your devices will both be downloading updates when there really is nothing important to update. For example, if you are having periodic pushes from your laptop using obsidian-git, and all that is happening is you’re reviewing your notes, well the workspace file is being edited. And now when you go to your phone, you need to fetch/pull changes.

Oh, and if you ever do want to start syncing workspace changes for whatever reason, you can always comment out the one liner in the .gitignore file by editing it to look like this: # .obsidian*/workspace. Then in terminal git add . to add those workspace files. And when you want to undo it, just do the steps I showed above having to do with git rm --cached ...

6 Likes

Thank so much

Hi,
I just install Obsidian (ios 1.0.4) but I don’t see the Obsidian folder on my on my iPhone folder (iCloud Drive Vault synchro is off).
If I turn on iCloud Drive Vault synchro, I’m able to see the Obsidian folder on my iCloud Drive folder.

Any idea ?

Licat gave me the solution here : Discord

Great, but you can use “.gitignore” instead of a different config folder.

Did you find a workaround for this? :slight_smile:

Just want to add a minor tips for noobs (like me):

Use case:

  • Once you setup the things to work well with Working Copy.
  • The push-pull steps are still annoying, especially for constant device-switching (write on mobile than continue on desktop, or the reverse)
  • And it should be auto in a way (for daily usage).

Solution

  • I think some people mention making a Shortcut (iOS supported and Working Copy) to sync.
  • What really helps me after making that shortcut is to make an Automation (also inside the Shortcut app) to trigger the Shortcut at either
    • a specific point in time (needs the iOS device to be unlocked, so a bit annoying).
    • OR at event of close (minimize) a certain app.

So I choose it to sync everytime I minimize Obsidian. That may creates a bunch more commit but I think the problem of managing conflicts went away for me for now.

4 Likes

Good tips. The iOS shortcut sync notifications were driving me insane every time I switched to Obsidian.

I settled on adding a sync shortcut right above Obsidian on my home screen, instead of triggering on open/close. Much quieter and I don’t find it that inconvenient to manually hit sync.

I actually moved back to 1Writer with WebDAV because Working Copy forgot the Sync Folder option after every update.

those annoying notifications can be turned off in near future

Apple has added a toggle to the Shortcuts app in iOS 15.4 that lets users disable the notifications that run when they trigger a specific Shortcuts automation. Prior to the iOS 15.4 beta, the Shortcuts app issued a notification every time a specific automation shortcut was triggered.

Brilliant, easy to follow instructions. Thank you!

I can’t see this Discord channel… can you please share the solution? :slight_smile:

I can’t see the “Obsidian” folder in Files “on my Iphone”…

Can the Obsidian Git plugin do all of this instead?

Worth to try.

The creator of that plugin warned that it’s not completely perfect for mobile yet.