DefenderOfBasic / obsidian-quartz-template

Template for hosting your Obsidian notebook on GitHub pages with CI deployment
MIT License
8 stars 26 forks source link

How to setup git in your existing vault? #1

Open DefenderOfBasic opened 1 month ago

DefenderOfBasic commented 1 month ago

The article covers how to setup a new vault and connect it to github. But what do you need to do to connect an existing one?

basically you need:

what we did in this article was (1) create a repository on GitHub.com (2) make a synced copy of it locally, with GitHub UI. That's what allows us to push to that repository on GitHub.com

So, if you have an existing Obsidian vault, you need to connect it with a repository. What I would do is copy the vault contents into source/content/. Then, once you confirm it's all working/you push, you can start using that as your main vault/delete the old location (don't delete the old one until you confirmed it's pushed/you can see it on github.com)

Otherwise you can make your existing folder into a git repository, which is a bit more steps (you have to initialize the git repo, point it to this repository, then fetch/resolve conflicts/force push)

xplusyi commented 1 week ago

Instead of "copy the vault contents into source/content/", you can try the 'mklink -D' commad on Windows to create a "shortcut" to your exisiting Obsidian vault. This will make the content folder exactly sync with Obsidian vault (like a mirror) from now on.

btw, I want to know how to config to ONLY publish the md files with tags 'publish: true' in a particular folder for example. Or, is there a way to "export" the tagged markdown files to a separate folder with the attached pictures and referenced files.

I'd like to thank your great effort to make the process much easier than the steps from original ''https://quartz.jzhao.xyz/''. And the folder structure is very clean.

axelknock commented 1 week ago

Publish: True can be enabled as a plugin, see ExplicitPublish.