I watched a few videos on how to setup the obsidian-git plugin and it feels like most of them overcomplicate the process. So I decided to write a set of instructions and a video to show how easy it to accomplish this even if you have no idea what “git” is.
By the end of this tutorial, you will be able to sync your notes from Obsidian to Github for free!
Create a repository or fork the md repo in github
Download Git
Create a personal access token from github
Install the Obsidian Git community plugin
Create a folder to store the repository. (e.g. remote-blog/
). Set scopes to repo & expiration to no expiration
Run the command (CMD/Ctrl + P): Clone an existing remote repo
Paste the URL of the forked repository in the following format
https://<PERSONAL_ACCESS_TOKEN>@github.com/<USERNAME>/<REPO>.git
For example it might look like this:
https://[email protected] /ithinkwong/linked-blog-starter-md.git
Then type in the folder you created in step 5 (e.g. remote-blog/
)
Restart Obsidian
Make edits to your notes
Publish your notes run the command “Obsidian Git: Create backup” by opening the command palette (CMD/Ctrl + P)
15 Likes
I tried this on my friends iPad but during the last steps it failed.
I think 7 or 8.
The error is that it does not show any files or folders.
Without showing any failure iin a popup.
I will investigate further but maybe you have an idea.
The first thing I have to google is how to activate the logs on iPad (I think I did it once…)
1 Like
Yes my git cloning failed on iPad too. Always aborting at some point of the directories.
2 Likes
I’ve only tested it on desktop versions. I think the mobile version of git is a different setup unfortunately.
2 Likes
hayyaun
December 8, 2023, 10:12am
5
I have a mobile setup version here, it’s quick way and working:
Setup obsidian-git on multiple devices
hayyaun
December 8, 2023, 11:54am
6
Here are 7 steps to create a live vault:
Create a vault using desktop app.
Install obsidian-git
community plugin inside the vault.
Settings > Community Plugins > Search
Create a github account or skip if you have one.
Create new repository
with README . (ex. you/notes)
Create a fine-granted access token to access the repo. here
Change to vault directory and clone using the access token.
git clone https://<token>@github.com/you/notes.git
Copy the vault folder to your mobile device.
Finally restart Obsidian and you are good to go!
Optional:
Take a look at Settings > Obsidian Git
.
Define your hotkeys in settings.
1 Like
What if you’ve already set this plugin up using another form of authentication (HTTPS/SSH)?
Assuming you already have the repo cloned somewhere, we’re going to edit the file .git/config
. These instructions should work on UNIX based systems.
Open a terminal
Navigate to your repo, ie cd <repo_name>
Open the file using your editor of choice, ie vim .git/config
or nano .git/config
(easier).
Find the line that starts with url =
, update it to reflect the instructions above.
Save and close the file.
Restart Obsidian.
Did this work for anyone at all? I cannot get it to push to github. Im getting 403 error
Are they any recommended settings to automatically push and pull changes? Basically I want Obisidian to sync with github automatically.
Thanks!
merovex
December 7, 2024, 2:28pm
10
I’m driving Linux, but this will work on Mac if you are comfortable with the terminal.
I have my laptop connected to Github via SSH. I then re-cloned my GH repo for my vault using SSH instead of HTTPS. Now it pulls/pushes without prompting for uname/passwd.