denolehov / obsidian-git

Backup your Obsidian.md vault with git
MIT License
6.12k stars 251 forks source link

[Bug]: wrong order in git backup #718

Open LFSaw opened 2 months ago

LFSaw commented 2 months ago

Describe the bug

Merge conflicts when doing Git: Create backup in a 2 machine scenario

Relevant errors (if available) from notifications or console (CTRL+SHIFT+I)

No response

Steps to reproduce

results in merge conflict.

Expected Behavior

no merge conflict.

This could be achieved by a git command sequence within Git: Create backup:

  1. git commit
  2. git pull [--rebase]
  3. git push

Addition context

No response

Operating system

macOS

Installation Method

None

Plugin version

2.24.1

Vinzent03 commented 2 months ago

I don't think this is an issue with the plugin. You just create a merge conflict, which the plugin can't solve more than git. You can set rebase to be used when pulling in the settings.

LFSaw commented 2 months ago

Thanks for taking the time looking into this!

I'd just like to have configuration in which I can save changes from both machines (as in the above scenario) in one action (per machine) without creating a merge conflict. I just tried using the "rebase" setting; unfortunately this does not change that I get an error message, however, it seems not to create a merge conflict...

The sequence

  1. edit file example.md on machine A
  2. edit file example.md on machine B (different edit)
  3. Git: Create backup on machine A
  4. git commit on machine B
  5. git pull --rebase on machine B
  6. git push on machine B

works for me without a merge conflict and without an error (given that an automatic merge is possible).

Vinzent03 commented 2 months ago

Please share your error messsage. So you are editing the file in two different places, right?