[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 ...

Thank so much