denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.14k stars 250 forks source link

[feature]: stronger submodule support #639

Closed YuKung closed 4 months ago

YuKung commented 8 months ago

I have to work with some situations when I want to use obsidian and git to collaborate with my teammates. For example, In my workspace, there are many folders, and one of them is the teamspace folder. I want to collaborate with my team in this folder through github without sharing other folders in the workspace. I want to know if we can realize this by adding the teamspace folder as an submodule, and use this plugin to backup my whole workspace with github repo1 and also backup the teamspace with another github repo2, so that I can collaborate with my teammates through repo2.

Nathan-Harlan commented 7 months ago

I'm also having some difficulties using the submodule functionality as you have described here. It may be user error, but when trying to commit a submodule I have to navigate into the submodule and commit it from the CL then Obsidian-git is able to commit and push the pointer in the main repo.

All that to say, I think the functionality is actually there but the documentation to set it up is a bit lacking. I would expect a change in the submodule to show up as effectively 2 separate commits, one to update the submodule and one to update the main repo submodule reference file. Instead the only change that is noticed is at the main repo level.

Check out #93 and the doc on it https://publish.obsidian.md/git-doc/Features#Submodules+Support

Nathan-Harlan commented 7 months ago

I was able to get this to work with the "Create backup" command set as a hotkey. You just have to make sure your git submodule set up is done right

YuKung commented 7 months ago

I was able to get this to work with the "Create backup" command set as a hotkey. You just have to make sure your git submodule set up is done right

I will try it, thank you!

HammyHavoc commented 5 months ago

Where did you land with this? Also super curious about using submodules because I want shared notes from family members within my own Obsidian vault.

endotronic commented 5 months ago

I landed here while looking to see if there is submodule support on mobile (Android anyway). I see an option on desktop to pull submodules, but I don't see this on mobile. Seems to fit under "stronger submodule support," so let me add to the request.

If someone has a way to do this from Obsidian, let me know! Otherwise I have to use Termux.

Vinzent03 commented 4 months ago

Submodules aren't supported by the underlying git implementation on mobile. To use submodules enable the option in the settings and refer to the documentation. I think the issue from Nathan Harlan got fixed.

If you still have a case that's not implemented, please create a new issue with a detailed description of your desired process.