It lets you use fully-featured git - the same git that runs on Alpine Linux
Cons:
It requires using the Linux command-line
There appears to be a bug in Obsidian 1.0.3 that doesn’t show new files in the file explorer after you pull them from GitHub. This can be easily circumvented by sorting the notes
Assuming you have an existing repo on GitHub. You can also create the repo right from iSH - the git command you’ll be using is the exact same fully-featured git from Alpine Linux.
Create a new empty local vault in Obsidian
In iSH:
First-time setup - install git:
Update Alpine repos: apk update
Install git: apk add git
Create a directory called obsidian in your home directory by running cd ~ && mkdir obsidian.
Mount your local vault folder into the obsidian folder
Run mount -t ios . obsidian
A file picker will show up
Choose the folder with your local vault
Clone your git repository into obsidian
Change directory to obsidian: cd obsidian
Delete the .obsidian folder: rm -rf .obsidian
git clone https://github.com/ForceBru/ObsidianVaultTest . - use your own repository instead. Don’t forget the period . - this is what allows you to clone the repo into the current folder.
(Optional) Run ls -a to see whether your files are there
In Obsidian
Restart Obsidian (might not be necessary)
Open the file explorer
Currently (Obsidian 1.0.3) it’s empty (looks like a bug)
Tap the “Sort” button (the rightmost one, with up/down arrows)
Select any sorting order you like
The files should appear
Use your Obsidian vault!
To push your changes, go back to iSH
Change directory to obsidian in your home directory: cd ~/obsidian
Run git status to confirm that there are modified files
Yes, pushing and pulling is manual via the command line. The data are stored on your device, but it might be possible to mount the iCloud folder in the same way.
iSH emulates an Intel x86 CPU, so yeah, it can be pretty slow sometimes. It’s indeed possible to add your own scripts - iSH runs real-world Alpine Linux, so it can do basically whatever Alpine can do, except for things restricted by iOS, like USB/Lightning connections.
The cd Command should include the vault name too right? Since obsidian will not have any git. At least it throws an error for me. git add . is way too slow for me as well.
Okay.
Sadly, it worked for a dummy vault, but as I introduced by own vault, it took ages to execute git add . and simply gets stuck despite keeping the app open forever. I haven’t synced .obsidian folder, only edited one test line in a single MD file. And still I am not able to commit😕
Also, I got into thinking. If working copy free version can sync a folder into obsidian folder and pull and commit, why not use it for everything except push(paid).
Then simply mount the working copy folder in ish or anything and git push!
Because, the add command etc are a lot slower in iSH.
Edit: It works!!
Everything is managed in WorkingCopy. iSH is utilised only for git push
Maybe a super noob manoeuvre.
I strongly dislike the idea of having my notes unencrypted on a hosting service like github so I extended the idea to support end-to-end symmetric AES256 encryption using gnupg on iSH. As the encryption is open source and cross platform you can decrypt your notes anywhere.
Steps:
Make a folders /obsidian and initialize a git repository. This will be a local git repo for rollbacks (see why it is needed later).
Make a subfolder /obsidian/vaults. Mount your ios obsidian folder here. Make sure to delete the .git file so the folder is staged correctly.
Make a folder /syncrepo. This is the repo that pushes/pulls encrypted files to/from the remote.
Initialize a repository in /syncrepo and connect it to your chosen remote repository.
Encryption is done using tar to compress the vaults folder into a single file, and then using gnupg to encrypt the file. As pulling involves overwriting parts of you existing vault, the local repository lets you rollback in case of an accidental pull.
Make sure to install gnupg using apk add gnupg.
Add the push/pull scripts to your root directory.
NOTE: Replace *** with your passphrase in scripts.
Pull script (~/pull)
#!/bin/sh
cd ~/obsidian
git add .
git commit -m "Save before pull"
echo "saved state before pull"
cd ~/syncrepo
git pull
cd ~
echo "pulled repo"
gpg -d --batch --cipher-algo AES256 --passphrase ****** -o - syncrepo/obsidianfile | tar -xzvf -
echo "uncompressed and decrypted"
Push script
#!/bin/sh
cd ~/obsidian
git add .
git commit -m "Save before Push"
echo "saved state before push"
cd ~
tar -czvf - obsidian/vaults | gpg -c --batch --cipher-algo AES256 --yes --passphrase ******* -o syncrepo/obsidianfile
echo "compressed and encrypted"
cd ~/syncrepo
git add .
git commit -m "Commit from Mobile"
git push
cd ~
echo "pushed to remote"
Set both files to run as scripts chmod +x ./pull (and for ./push)
It’s actually pretty similar to the instructions above for iSH. the difference is that instead of git, the command is lg2. Also, instead of using mount to mount the file provider, the command is pickFolder to create what aShell calls a bookmark. then it’s jump bookmarkname to get into the folder.
Try help at the prompt to get a list of all the aShell specific commands.
As for the shortcut, it depends on what you want it to do. You just use the action to give aShell commands, make sure the first command in the list is to jump into your repo folder and then lg2 push or lg2 add or whatever.