Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot commit #172

Closed
Mindweave opened this issue Jan 27, 2022 · 4 comments
Closed

[Bug]: Cannot commit #172

Mindweave opened this issue Jan 27, 2022 · 4 comments

Comments

@Mindweave
Copy link

Describe the bug

Just downloaded plugin and followed instructions at https://github.com/gitobsidiantutorial/obsidian-git-tut-windows. When commiting changes an error pops up (pasted below)

Relevant errors (if available)

git obsidian error: warning: could not open directory '.../.../Assets/': No such file or directory
warning: could not open directory '.../.obsidian/': No such file or directory
warning: could not open directory '.../.trash/': No such file or directory
warning: could not open directory '.../Notes/': No such file or directory
warning: could not open directory '.../Readwise/': No such file or directory
warning: could not open directory '.../Templates/': No such file or directory
warning: LF will be replaced by CRLF in .obsidian/plugins/recent-files-obsidian/data.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .obsidian/workspace.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in Notes/Active Notes/Action Theory.md.
The file will have its original line endings in your working directory
error: open(".../.md"): No such file or directory
error: unable to index file '.../.md'
fatal: adding files failed

error-detection.plugin.ts:38 Uncaught (in promise) Error: warning: could not open directory '.../.../Assets/': No such file or directory
warning: could not open directory '.../.obsidian/': No such file or directory
warning: could not open directory '.../.trash/': No such file or directory
warning: could not open directory '.../Notes/': No such file or directory
warning: could not open directory '.../Readwise/': No such file or directory
warning: could not open directory '.../Templates/': No such file or directory
warning: LF will be replaced by CRLF in .obsidian/plugins/recent-files-obsidian/data.json.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in .obsidian/workspace.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in Notes/Active Notes/Action Theory.md.
The file will have its original line endings in your working directory
error: open(".../.md"): No such file or directory
error: unable to index file '.../.md'
fatal: adding files failed

    at Object.action (eval at <anonymous> (app.js:1), <anonymous>:1891:29)
    at PluginStore.exec (eval at <anonymous> (app.js:1), <anonymous>:1926:29)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2364:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (eval at <anonymous> (app.js:1), <anonymous>:2362:16)
    at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2346:44)
    at Generator.next (<anonymous>)
    at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:2266:28)
    at processTicksAndRejections (internal/process/task_queues.js:93)

Steps to reproduce

  1. Ctrl+P
  2. search for "Git"
  3. select "Obsidian Git: Commit All Changes"

Expected Behavior

The selection would commit changes allowing me to push changes to repo

Addition context

I only just downloaded the plugin so it has not worked in the past for me. While I followed the instructions, it could be a setup issue.

Operating system

Windows

@Yuan0100
Copy link

I am facing the same issue when using the source control panel to stage single file, it seems like adding the dir name again in front of the file path. However, it works well if I stage with the "stage all" button.

@Vinzent03
Copy link
Owner

@ThisIsDoubleC Hmm weird. The paths start all with three dots (.../)

@Yuan0100

it seems like adding the dir name again in front of the file path

Do you have an example? And which dir name? The vault name/git root dir name?

@Yuan0100
Copy link

Yuan0100 commented Jan 30, 2022

@Vinzent03 Here is an example:

error messages in the console

(unknow)

git obsidian error: warning: could not open directory 'src/my-vault/src/my-vault/_PRIVATE/ZK/': No such file or directory
fatal: pathspec 'src/my-vault/_PRIVATE/ZK/20220128-102303.md' did not match any files

(index.html:1891)

Uncaught (in promise) Error: warning: could not open directory 'src/my-vault/src/my-vault/_PRIVATE/ZK/': No such file or directory
fatal: pathspec 'src/my-vault/_PRIVATE/ZK/20220128-102303.md' did not match any files

    at Object.action (eval at <anonymous> (app.js:1), <anonymous>:1891:29)
    at PluginStore.exec (eval at <anonymous> (app.js:1), <anonymous>:1926:29)
    at eval (eval at <anonymous> (app.js:1), <anonymous>:2364:43)
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (eval at <anonymous> (app.js:1), <anonymous>:2362:16)
    at GitExecutorChain.eval (eval at <anonymous> (app.js:1), <anonymous>:2346:44)
    at Generator.next (<anonymous>)
    at fulfilled (eval at <anonymous> (app.js:1), <anonymous>:2266:28)

file structure like this

root
|--- .git
|--- src
|     |--- my-vault
|          |--- .obsidian
|          |--- _PRIVATE
|               |--- ZK
|                    |--- 20220128-102303.md

@Vinzent03
Copy link
Owner

@Yuan0100 Thanks, I can reproduce. I'm pretty sure it's because your vault is below the .git folder. Will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants