Howdy! I just recently started using Obsidian after switching from ROAM research and one problem I wanted to solve immediately was backing up my files! With a lot of help from the community, particularly @foreveryone on the discord community, I managed to get Obsidian Git working. It took me probably 2 hours of troubleshooting and a lot of sadness, but hopefully having something like this on the forums will make it easier for other people who are swapping to Obsidian.
–Downloading the Obsidian Git plugin workflow (assuming you already have a vault)–
Open your obsidian vault
Go to the cogwheel on the bottom left of the screen that says settings and click on it
Select the community plugins option.
Turn safe mode off
Browse community plugins and search for Obsidian Git by Denis Olehov
Install Obsidian Git
Go back to the community plugins tab and enable obsidian git.
Select Obsidian Git from the plugin options
Enable Pull updates on startup
10.** Disable the “disable push” option (haha double negative)** CRUCIAL.
The next step is the hardest and it involves creating a new GitHub repository and connecting that GitHub repository to your local vault! Make sure you already made a GitHub account before this step. your credentials are important
–Connecting Github Repository to Local Obsidian Vault–
1. Download Git Desktop. (This will be used to connect your local vault to the online GitHub repository)
The first git desktop screen you see will prompt you to “sign in to GitHub.com.” Sign in and use your git hub info
If you’re already logged into Github it will open it in a browser and just ask you for your password
If you sign in correctly you’ll be asked to authorize the desktop/laptop you’re on and Git desktop will then reopen
It will also give you a choice of email to use (either a personal one you use when you made the online GitHub account or an autogenerated one). Either is fine.
This next step is about creating a repository on GitHub and connecting it to git desktop
Create a new private repository and name it whatever you want
Make sure you don’t select any of the options to initialize the repository. Not even the readme file.
Click the green button that says create a repository
You’ll see 4 options for creating a repository. Click the “set up in desktop” option.
Git desktop will open up and you can then click the blue “clone” button.
Now you have made an empty repository on GitHub! HALFWAY THERE WOOHOO!!!
**This last step is about pointing your git desktop repository to your local Obsidian vault! **
From git desktop click on the “show in explorer” button in your empty repository.
This should open up the location of the git repo on your local device! We want to move some files from this folder to your obsidian folder!
Go to the “view” option near the top left of your file explorer
Select “options” (should be the furthest right of all your choices in the view box)
From “options” click on the “view tab”
Turn the “hidden files and folders” option to “show hidden files, folders, and drives” and select ok.
You should now be able to see the previously hidden .git folder in your local repo!
Copy this .git folder to your local obsidian vault. It is fine to have the .git folder in both places. This is super important because it is what allows the Obsidian Git extension to do its job.
Now that you have your .git metadata in your Obsidian vault you can go to obsidian, open up the command palette with (Ctrl + P) and type in Obsidian Git.
You should then click on the “Commit all changes and push to remote repository” option.
You should get a prompt from the Obsidian Git plugin in Obsidian letting you know that your files within the local obsidian vault are being transferred to your remote repository
Final step is to check your GitHub repo and see if it has updated!
Once again, a huge thanks to the Obsidian discord and @foreveryone for helping me with this workflow! If you have any questions feel free to ping me on the discord and I’ll do my best to help you!
Yep! I got it syncing with obsidian git. And the functionality was maintained even after moving my vault folder from my downloads to my desktop! Ah you meant the configurations. Yeah those were synced too. It syncs everything within the vault from plugins to shortcuts. I would recommend changing the obsidian git commit command to like ctrl + shift + s so you can do it manually with ease.
Putting .obsidian in your .gitignore will not sync your settings and workspaces, but if you don’t want your settings to sync, it’s fine to put .obsidian in your .gitignore.
When you go into settings, you should see “Obsidian Git” under “Plugin Options” on the left. If you click on “Obsidian Git,” you should be able to tinker with the settings you are referring to.
AH that’s the problem. I don’t see Obsidian Git under Plugin Options. I installed it from within Obsidian; perhaps a manual installation is called for?
Ok so I had an error for obsidian config files again.
Basically, sync with github between two windows computer.
Here the error :
Uncaught (in promise) Error: From https://github.com/####/Zettelkasten
18bf750..b352192 main -> origin/main
error: Your local changes to the following files would be overwritten by merge:
.obsidian/workspace
Please commit your changes or stash them before you merge.
Aborting
at GitExecutorChain.onFatalException (eval at <anonymous> (app.js:1), <anonymous>:2302:85)
at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2293:28)
at Generator.throw (<anonymous>)
at rejected (eval at <anonymous> (app.js:1), <anonymous>:2247:65)
11index.html:2302 Uncaught (in promise) Error: Error: spawn git ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267)
at onErrorNT (internal/child_process.js:469)
at processTicksAndRejections (internal/process/task_queues.js:84)
at GitExecutorChain.onFatalException (eval at <anonymous> (app.js:1), <anonymous>:2302:85)
at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2293:28)
at Generator.throw (<anonymous>)
at rejected (eval at <anonymous> (app.js:1), <anonymous>:2247:65)
DevTools failed to load SourceMap: Could not parse content for app://obsidian.md/main.js.map: Unexpected end of JSON input
and
VM392:131 Uncaught (in promise) Error: Error: spawn git ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267)
at onErrorNT (internal/child_process.js:469)
at processTicksAndRejections (internal/process/task_queues.js:84)
at GitExecutorChain.onFatalException (eval at <anonymous> (app.js:1), <anonymous>:2302:85)
at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2293:28)
at Generator.throw (<anonymous>)
at rejected (eval at <anonymous> (app.js:1), <anonymous>:2247:65)
So you have obsidian git, git client, and the git hub repository set up but you’re experiencing conflicts when pushing changes from your local vault to your remote repository? I may need to update the initial forum post to add the .gitignore file. What does your remote repository look like on Github right now? Is it possible to display an image of that in this thread?