|
| 1 | +--- |
| 2 | +title: "Obsidian to GitHub Sync" |
| 3 | +description: How to sync Obsidian with GitHub (Using a YouTube guide) |
| 4 | +date: 2025-03-16 15:03:00 CST |
| 5 | +layout: post |
| 6 | +categories: [homelab, notes] |
| 7 | +tags: [obsidian, GitHub, git, sync, token] # Tag names should always be lowercase |
| 8 | +permalink: /obsidian/ |
| 9 | +pin: no |
| 10 | +toc: true |
| 11 | +--- |
| 12 | + |
| 13 | + |
| 14 | +# Goal - Sync Obsidian with GitHub |
| 15 | +## Purpose |
| 16 | +I want to sync my Obsidian notes with GitHub so I could back the data up and also learn about the process. Also, It can sync across devices. |
| 17 | + |
| 18 | +## Outline of the steps |
| 19 | +- Download Git on your computer if you have not |
| 20 | +- Generate a GitHub Personal Access Token. |
| 21 | +- Create the folder on GitHub |
| 22 | +- Create the folder on your PC |
| 23 | +- Clone the repository locally. |
| 24 | + |
| 25 | +## Guide Used (My Revision of the Guide Below) |
| 26 | +-I liked this guide for generating the token. However, the linked guide is ambiguous about the token’s duration, and the video doesn’t set an expiration. “Security is not convenient.” Your call. [Token guide](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) I revised this guide a bit to what is below |
| 27 | + |
| 28 | +1. In the upper-right corner of any page on GitHub, click your profile photo, then select Settings. |
| 29 | +2. In the left sidebar, click **Developer settings**. |
| 30 | +3. In the left sidebar, under **Personal access tokens** click **Tokens (classic)**. |
| 31 | +4. Select **Generate new token**, then **click Generate new token (classic)**. |
| 32 | +5. In the "Note" field, give your token a descriptive name. |
| 33 | +6. Choose the expiration length |
| 34 | +7. You only need to check **Repo** |
| 35 | +8. Click **Generate token.** |
| 36 | +9. Copy the new token to your clipboard and paste it in a `.txt` file or something. Or save in PW manager, but we will need it soon. |
| 37 | + |
| 38 | +## Create a Repository on GitHub |
| 39 | +- Click **Repositories** |
| 40 | +- The Green **NEW** button |
| 41 | +- Name it. |
| 42 | +- **Important** Check the little box that says "Add a README" |
| 43 | + |
| 44 | +## Install Git on your PC if it is not there |
| 45 | +- [Install Git](https://git-scm.com/downloads) |
| 46 | + |
| 47 | +## Make a folder on your PC |
| 48 | +- Use File Explorer (or your preferred method) to create a new folder. |
| 49 | + |
| 50 | +## Install the `Git` Plugin in Obsidian |
| 51 | +- Click the Cog icon in the bottom left |
| 52 | +- Middle of the page **Community Plugins** |
| 53 | +- Type `Git` |
| 54 | +- Click **Install**. |
| 55 | +- Click **Enable** (Two clicks, dont forget.) |
| 56 | + |
| 57 | +## Get that token formatting going |
| 58 | +- I liked that quick `.txt.` doc, becasue I am not a typer, I cut and paste, and it is good to have it in front of you. |
| 59 | +- We need to get the format of this `https://<PERSONAL_ACCESS_TOKEN>@GitHub.com/<USERNAME>/<REPO>.git` |
| 60 | +- For example: `https://xxxxxxxxxxxxxxxxx@GitHub.com/TheColetrain/Obsidian.git` |
| 61 | + |
| 62 | +## Clone the Repo |
| 63 | +- you should have your Obsidian open in the folder you want to be synced with GitHub |
| 64 | +- Run the command (Ctrl + P): **Git:Clone an existing remote repo** |
| 65 | +- Paste your formatted URL including token in the first blank |
| 66 | +- I say, Leave the second field blank, and hit enter. *(Read the next part before continuing)* |
| 67 | + |
| 68 | +- ### I pretty much did this whole write up becasue **I had trouble with this part.** |
| 69 | + - The videos and guides all seem to type something in to that second field, "Obsidian" in my case. When I typed "Obsidian" in the 2nd blank, then I got a `Obsidian>Obsidian` subdirectory scenereo. |
| 70 | + |
| 71 | + - Full disclosure. I dont know nuttin'. But When I got that subdirectory scenereo, I could see it made some hidden files, `.Obsidian` and it was linked somehow. Because it didnt like me changing it. Maybe deleting the hidden files would have worked, but I ended up deleting the repository, and the folder. Then I made a repository `Obsidian1` and folder `Obsidian1.` And did what I said above. |
| 72 | + |
| 73 | +## Hope this Helps. |
| 74 | + |
| 75 | +#### Below is my preferred Video that I found |
| 76 | + |
| 77 | +<iframe width="560" height="315" src="https://www.YouTube.com/embed/ImrLbomFYA0?si=RzsGefLMTvnhKgcI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> |
| 78 | + |
| 79 | +> |
| 80 | +> |
| 81 | +> |
| 82 | +#### Here is another Guide. The video below this link, is redundant, as it can also be found in the guide. |
| 83 | + |
| 84 | +[The Easiest Way to Connect Your Obsidian Vault with Github](https://linked-blog-starter.vercel.app/connect-obsidian-vault-with-github) |
| 85 | +> |
| 86 | +> |
| 87 | +> |
| 88 | +
|
| 89 | + |
| 90 | +<iframe width="560" height="315" src="https://www.youtube.com/embed/5YZz38U20ws?si=jfjUMYiMZw6HEmqy" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe> |
0 commit comments