obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

[Bug]: Error: Git.cwd: cannot change to non-directory

Open ssmmtt opened this issue 2 years ago • 17 comments

Describe the bug

image image

Use git in msys2 of.

Relevant errors (if available)

No response

Steps to reproduce

Upgrading to the latest version is no good. There is no problem with the previous version.

Expected Behavior

No response

Addition context

No response

Operating system

Windows

Plugin version

2.14.0

ssmmtt avatar Dec 21 '22 02:12 ssmmtt

Can you share your plugin settings?

Vinzent03 avatar Dec 21 '22 14:12 Vinzent03

Can you share your plugin settings?

image image

ssmmtt avatar Dec 21 '22 15:12 ssmmtt

I uninstall and reinstall, and the default configuration doesn't work either.

ssmmtt avatar Dec 21 '22 15:12 ssmmtt

image image Version 2.6.0 can be used normally.

ssmmtt avatar Dec 21 '22 15:12 ssmmtt

That is strange, may you share the output of app.vault.adapter.basePath in the console?

Vinzent03 avatar Dec 21 '22 18:12 Vinzent03

That is strange, may you share the output of app.vault.adapter.basePath in the console?

image

ssmmtt avatar Dec 22 '22 03:12 ssmmtt

I encountered the same problem. After re-installation of git, just restart the computer, and then Obsidian returned to normal. I guess it is caused by environmental variables.

lvbibir avatar Mar 31 '23 06:03 lvbibir

Same problem, have you sovled it already? Maybe we should install git from git-scm.com instead msys2?

hartvon avatar Aug 31 '23 06:08 hartvon

Same problem, have you sovled it already? Maybe we should install git from git-scm.com instead msys2?

After uninstalled git from msys2, and then resintall it from git-scm.com, the obsidian-git worked! I wonder why the error occured in msys2' git version, maybe it is a bug? @Vinzent03

hartvon avatar Aug 31 '23 06:08 hartvon

I no longer use mysys2.

ssmmtt avatar Aug 31 '23 09:08 ssmmtt

I apologize for necroposting, but this error has been happening to me for quite a while and would be useful if this is solved.

I already tried the solutions on this open issue and I can't find a way to solve it.

The error is the same as the one on the first post:

Error: Error: Git.cwd: cannot change to non-directory "/c/REPOSITORIOS/obsidian_uni"
    at GitExecutorChain.onFatalException (plugin:obsidian-git:26622:79)
    at GitExecutorChain.eval (plugin:obsidian-git:26614:24)
    at Generator.throw (<anonymous>)
    at rejected (plugin:obsidian-git:25483:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

JesusJMUJI avatar Nov 28 '23 15:11 JesusJMUJI

@JesusJMUJI What's your custom base path option in the settings and what OS are you on?

Vinzent03 avatar Nov 30 '23 15:11 Vinzent03

@JesusJMUJI What's your custom base path option in the settings and what OS are you on?

@Vinzent03 : These are my Obsidian-Git advanced settings, I didn't touch anything. image

Also, I'm on Windows 11, latest patch and service pack. Do you need anything else?

JesusJMUJI avatar Nov 30 '23 15:11 JesusJMUJI

May you as well share the output of app.vault.adapter.basePath in the console? I assume you are using the git version from https://git-scm.com ?

Vinzent03 avatar Nov 30 '23 15:11 Vinzent03

May you as well share the output of app.vault.adapter.basePath in the console? I assume you are using the git version from https://git-scm.com ?

Here's what the console outputs: image

And yes, I downloaded GIT from that website. Is there another way to download Git?

JesusJMUJI avatar Nov 30 '23 15:11 JesusJMUJI

I had this problem too. Apparently, there is an old git version installed somewhere on my Windows PC, but I can't find it to uninstall it.

Just set the Custom Git binary path to wherever the git-scm.com one is.

C:\Program Files\Git\bin\git.exe in my case.

image

That did the trick for me.

SanderVanhove avatar Dec 02 '23 15:12 SanderVanhove

I had this problem too. Apparently, there is an old git version installed somewhere on my Windows PC, but I can't find it to uninstall it.

Just set the Custom Git binary path to wherever the git-scm.com one is.

C:\Program Files\Git\bin in my case.

image

That did the trick for me.

Hello! I tried your proposed solution and it worked! Many thanks. Finally, I'm able to use git on obsidian again. I'm very curious about the "having two git installs". Perhaps it's what's happening to me to?

P.S: I put the path and the moment I was writing to say that didn't work, it seems I missed putting \git.exe on the custom path. Talk about not double-checking.

JesusJMUJI avatar Dec 02 '23 18:12 JesusJMUJI

Much has changed in the handling of the base directory since creation of the issue, so I'm going to close this now. Please open a new issue if you face this again.

Vinzent03 avatar Jul 11 '24 23:07 Vinzent03