kevinmkchin / Obsidian-GitHub-Sync

Sync Obsidian vault to personal GitHub
MIT License
110 stars 12 forks source link

Config and instructions fail for default branch named "master" #10

Closed litemotiv closed 3 months ago

litemotiv commented 3 months ago

The plugin currently expects a branch named "main", however on many systems the default git branch will be named "master". The instructions in the Readme will then fail:

$ git add .
$ git commit -m "my obsidian vault first commit"
$ git remote add origin <remote-url>
$ git push -u origin main

error: src refspec main does not match any

Perhaps it would help to instruct users that after issuing git init, the user would need to issue:

git branch -m main

in order for the plugin to work.

When the branch is not named main, the plugin will give back merge errors without a clear cause or solution to the user.

kevinmkchin commented 3 months ago

Yea I imagined it wasn't a big enough problem to add a note about it but I can do that. Please let me know if there are any other issues you are running into while using this plugin. It works fine for me but I never know if it works well for others too.

litemotiv commented 3 months ago

Thanks @kevinmkchin, so far the plugin seems to work great once the repository is linked properly. It's a nice minimal solution, i like it. :+1: