denolehov / obsidian-git

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

[Bug]: $GIT_CONFIG_GLOBAL ignored #729

Closed slnc closed 3 weeks ago

slnc commented 4 weeks ago

Describe the bug

I use $GIT_CONFIG_GLOBAL to point git to my .gitconfig, which doesn't live in ~/.gitconfig, but Obsidian Git is ignoring it.

image

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

- Obsidian Git complains that it can't find my credentials whenever it tries to make a backup.
- Git commits are created but with the wrong authorship and no GPG-signing occurs.

Steps to reproduce

Expected Behavior

Obsidian Git uses the .gitconfig file pointed at by $GIT_CONFIG_GLOBAL.

Addition context

No response

Operating system

Windows

Installation Method

None

Plugin version

2.20.5

Vinzent03 commented 3 weeks ago

Your .zshrc is not read since no zsh shell is started. You need to set the environment variable somewhere so that Obsidian gets it when started. The easiest way though is through the "Additional environment variables" setting in the plugin settings.

slnc commented 3 weeks ago

Thanks @Vinzent03, problem solved, I had missed that setting on the plugin settings page.