Permalink
Newer
100644
60 lines (56 sloc)
4.02 KB
1
- [iSH](https://ish.app) is a _free_ and [open-source](https://github.com/ish-app/ish) iOS app that runs real-world [Alpine Linux](https://alpinelinux.org/about/) on your iDevice by emulating an Intel x86 CPU. It can run many native x86 programs (_not_ compiled for iOS!), including Git.
2
- It can also [`mount` iOS file providers](https://github.com/ish-app/ish/wiki/Mounting-other-file-providers), which lets you access your local vault in Obsidian.
3
4
These features allow you to sync your Obsidian vault with GitHub (private and public) without leaving your iDevice.
5
6
# Workflow
7
8
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.
12
1. _First-time setup_ - install git:
13
1. Update Alpine repos: `apk update`
14
2. Install git: `apk add git`
15
2. Create a directory called `obsidian` in your home directory by running `cd ~ && mkdir obsidian`.
16
3. Mount your local vault folder into the `obsidian` folder
17
1. Run `mount -t ios . obsidian`
18
2. A file picker will show up
19
3. Choose the folder with your local vault
21
1. Change directory to `obsidian`: `cd obsidian`
22
2. Delete the `.obsidian` folder: `rm -rf .obsidian`
23
3. `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_](https://stackoverflow.com/questions/9864728/how-to-get-git-to-clone-into-current-directory).
24
4. (Optional) Run `ls -a` to see whether your files are there
33
3. To __push__ your changes, go back to iSH
34
1. Change directory to `obsidian` in your home directory: `cd ~/obsidian`
35
2. Run `git status` to confirm that there _are_ modified files
36
3. _First-time setup_ - tell git who you are:
37
1. [Set username](https://docs.github.com/en/get-started/getting-started-with-git/setting-your-username-in-git) for _this_ repository only (or set it globally with a slightly different command): `git config user.name ForceBruMobile`
38
2. [Set e-mail address](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address#setting-your-commit-email-address-in-git): `git config user.email "ForceBru@users.noreply.github.com"`
39
4. Add files, commit and push. For example:
40
1. Add _all_ files into the commit: `git add .`
41
2. Commit: `git commit -m "Commit from mobile"`
42
3. Push: `git push`
43
1. This will ask you to enter your username and password
44
2. [Git can use your personal access token to login automatically](https://docs.github.com/en/get-started/getting-started-with-git/why-is-git-always-asking-for-my-password)
45
4. That's it! Take a look at [this example commit from iSH](https://github.com/ForceBru/ObsidianVaultTest/commit/f642c3334a870ca8ab2aa1355528403502433b2b)
46
4. To __pull__ changes from GitHub:
47
1. In iSH:
49
2. (Optional) Check whether there is stuff to pull
50
1. Bring remote refs up to date: `git remote update`
51
2. Check status: `git status`
52
1. It should say something like `Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded` if there is something to be updated
53
3. Actually update from the remote repo: `git pull`
55
1. Go to file explorer
56
2. If you don't see your new notes, do the sort trick again:
57
1. Tap the "Sort" button (the rightmost one, with up/down arrows)
58
2. Select any sorting order you like
59
3. The files should appear
60
3. Updates to _existing_ notes seem to be reflected correctly