Vinzent03 / obsidian-git

Integrate Git version control with automatic backup and other advanced features in Obsidian.md
MIT License
6.67k stars 281 forks source link

[Feature]: newest file feature #740

Closed 3fok closed 2 months ago

3fok commented 3 months ago

I want to update the newest versions of some files to continue working on another PC (e.g., workspace.json, app.json, etc.). Can you add that feature? It should ignore local files and just get the newest files from GitHub.

I don't want to ignore these files because I want to keep the environment I'm working in and continue on another PC.

Vinzent03 commented 3 months ago

I can't follow you completely. You don't want to ignore the files completely, so you don't want to add them to .gitignore. But when there is a commit with a newer version of e.g. config files, you don't want to merge them or even have merge conflict, but just overwrite them with the new commit? The best way to accomplish this is probably, before pulling locally, to discard the changes via the Source Control View. So that these changes aren't commited locally and are overwritten by the new commit.

3fok commented 3 months ago

I want to continue working with the same state on another machine. For example, if I open a file on one computer, I want it to remain open when I switch to another computer. Is there any way to do that?

ridhozhr10 commented 3 months ago

I want to continue working with the same state on another machine. For example, if I open a file on one computer, I want it to remain open when I switch to another computer. Is there any way to do that?

It will be nice if we have this, for me to workaround for now i just use "Workspaces" core plugin and make a layout template before pushing latest commit to git remote. image image Screenshot from 2024-06-27 09-01-47 Screenshot from 2024-06-27 09-02-03

Vinzent03 commented 2 months ago

Yeah saving and then loading the workspace on the other machine is a great idea. If you have your current workspace.json not ignored it gets committed as well. But that causes a high risk of merge conflicts, and you have to restart Obsidian to reload from the updated workspace.json. But I don't plan to implement further features for this use case.