Skip to content

Commit b20cece

Browse files
committed
Update README.md
1 parent 12feb2c commit b20cece

File tree

4 files changed

+53
-21
lines changed

4 files changed

+53
-21
lines changed

README.md

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@
22

33
Plugin to sync a GitHub repository with an Obsidian vault.
44

5-
> [!CAUTION]
6-
> This is still in beta, logging is enabled by default.
7-
> I suggest you don't disable for the time being while using the plugin
8-
> as the logging information might be useful to fix some issues.
9-
105
I highly recommend not using this plugin with another sync service.
116
This might create problems for this plugin when determining what needs to be synced between remote repository and local vault.
127

13-
### Issues
14-
15-
If you find any problem please open an issue with as many details as possible.
16-
If could include the `github-sync.log` file found in your config directory that would be very helpful.
17-
188
## Features
199

2010
These are the main features of the plugin:
@@ -24,13 +14,13 @@ These are the main features of the plugin:
2414
- Multiple vaults sync
2515
- Automatic sync on fixed interval
2616
- Manual sync
17+
- Conflict resolution view
2718

28-
- Conflicts handling (TODO 🔨)
2919
- Filtering by file type (TODO 🔨)
3020

3121
## Installation
3222

33-
The plugin is still in beta so it's still not available in the community plugins.
23+
The plugin is still not available in the community plugins.
3424

3525
For the time being you can install it with BRAT. If you never used BRAT see [the official quick start guide](https://tfthacker.com/brat-quick-guide).
3626

@@ -40,21 +30,36 @@ If you already have BRAT installed to install GitHub Sync copy the following lin
4030
obsidian://brat?plugin=https://github.com/silvanocerza/obsidian-github-sync
4131
```
4232

33+
### Issues
34+
35+
If you find any problem please open an issue with as many details as possible.
36+
37+
Please also provide logs if possible, you can find the `github-sync.log` file in your config directory. Remember to enable logging first.
38+
39+
![Enable logging](./assets/log_enable.png)
40+
4341
## Usage
4442

4543
### First sync
4644

47-
When starting the plugin for the first time a dialog will guide you through the setup process.
45+
> [!IMPORTANT]
46+
> The first sync will only work if either the remote repository or the local vault are completely **EMPTY**. If both contain files the first sync will fail.
47+
48+
You must also configure the plugin settings before syncing.
4849

49-
If you already have files in your vault I strongly recommend you to create a new private GitHub repository and sync with that.
50+
These settings are mandatory:
5051

51-
> [!NOTE]
52-
> Onboarding is currently not supported on mobile.
52+
- Your GitHub Token (see below)
53+
- Repository owner
54+
- Repository name
55+
- Repository branch
56+
57+
If any of this is not set sync won't start.
5358

5459
### Token
5560

5661
A GitHub Fine-grained token is required to sync with your repository. You can create one by clicking [here](https://github.com/settings/personal-access-tokens/new).
57-
The token must have the `Contents` permission set to `Read and write` like in the screenshow below.
62+
The token must have the `Contents` permission set to `Read and write` like in the screenshot below.
5863

5964
![GitHub Fine-grained token](./assets/token_permissions.png)
6065

@@ -71,12 +76,26 @@ If you don't want to see the button you can hide it, just check the plugin setti
7176

7277
The `Sync with GitHub` command is also available.
7378

79+
### Conflict resolution
80+
81+
When you sync multiple vaults using this plugin you might risk creating conflicts between the remote and a local vault.
82+
This usually happens when the remote has a new update from vault A, but vault B edits the file before syncing with remote.
83+
That creates a conflict, by default we'll open a view to let you resolve the conflict since you should have all the necessary
84+
information to correctly resolve it.
85+
86+
By default the split view will be used on desktop and the unified one on mobile, you can change the settings to always use the one you prefer.
87+
88+
![Split conflict resolution](./assets/split_diff_view.png)
89+
![Unified conflict resolution](./assets/unified_diff_view.png)
90+
91+
If you don't want to resolve them you can change the settings to always prefer either the remote or local version in case of conflicts.
92+
7493
### Config sync
7594

7695
If you want to sync your vault configs with other vault you can enable that.
7796
It will sync the whole folder, that is `.obsidian` by default, including all plugins and themes.
7897

79-
Note that the `.obsidian` folder will always be present, that happens cause the plugin
98+
Note that the `.obsidian` folder will always be present, this happens because the plugin
8099
needs to store some metadata to correctly sync
81100

82101
> [!CAUTION]
@@ -85,10 +104,23 @@ needs to store some metadata to correctly sync
85104
86105
### Reset
87106

88-
I still have to add a reset button to clean the plugin settings and metadata.
107+
If you need to reset the plugin settings and metadata you can easily do that in the settings.
108+
109+
That will completely wipe all the sync metadata so you'll have to repeat the first sync as if you just enabled the plugin for the first time.
110+
111+
## What's different from other sync plugins?
112+
113+
There are obviously other plugins that let you sync your vault with GitHub or other git hosts, like [`obsidian-git`](https://github.com/Vinzent03/obsidian-git) and [`Obsidian-GitHub-Sync`](https://github.com/kevinmkchin/Obsidian-GitHub-Sync) just to name a couple.
114+
115+
Most of those plugins though require the `git` executable to be present in your system, they might rely on Bash scripts too. This makes them much less portable, it's harder to use on Windows, and mobile is really unstable because most of the times they rely on [`isomorphic-git`](https://isomorphic-git.org/).
116+
117+
This annoyed me because I wanted to have the same experience on every platform, and I wanted especially to support mobile.
118+
119+
So I went a different way and chose to sync **only** with GitHub using their REST APIs, this means I don't rely in anyway on `git` being present in your system. This way I can easily support desktop and mobile with the same identical logic, and some small necessary differences in the UI for a better user experience.
120+
121+
This obviously comes with some limitations. Since `git` is not used you can't interact with your repository locally in any way, and any `git` feature like branching, merging, or rebasing, are not available at all.
89122

90-
For the time being you can reset the plugin by disabling it in the plugins list and deleting the `github-sync-metadata.json`
91-
and `github-sync.log` files in your config directory, `.obsidian` by default.
123+
Also since this relies only on the GitHub APIs you can only sync with GitHub and no other host.
92124

93125
## License
94126

assets/log_enable.png

12 KB
Loading

assets/split_diff_view.png

135 KB
Loading

assets/unified_diff_view.png

143 KB
Loading

0 commit comments

Comments
 (0)