Vinzent03 / obsidian-git

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

[Bug]: "fatal: Could not read Username: Device Not Configured" #254

Open mutachre opened 2 years ago

mutachre commented 2 years ago

Describe the bug

I'm getting the error "fatal: Could not read Username for 'https://www.github.com/': Device Not Configured" everytime Obsidian tries to push. I'm running on OS X Monterey 12.1 / Apple M1. Any idea how to solve?

Schermata 2022-07-01 alle 13 52 28

Relevant errors (if available)

No response

Steps to reproduce

Auto or manual commit.

Expected Behavior

No response

Addition context

No response

Operating system

macOS

Plugin version

1.26.1

peterkaminski commented 2 years ago

In my experience, this isn't an Obsidian Git problem, it just means authentication isn't set up.

There are two paths forward:

  1. If you use Git from the command-line or another app, and you have a GitHub SSH key set up, you need to switch your remote URL from HTTPS to SSH.
  2. Otherwise, you need to cache your Git credentials. I haven't done this, but I can include some links to pages that might help below (no guarantees).
mutachre commented 2 years ago

Thank you. Apparently it seems to be solved by switching from https to ssh, probably the issue was triggered by 2FA. This is my first time using an ssh key, I will try to test it some more.

Vyeche commented 2 years ago

Interesting, I got it close. I used the first link on switching to SSH.

I followed:

Uncaught (in promise) Error: ssh_askpass: exec(/usr/bin/ssh-askpass): No such file or directory
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

After I install SSH_ASKPass. I'm getting a prompt.

I may have messed up this step.

sh-keyscan -t rsa github.org >> ~/.ssh

The example that was given:

        ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts

Screenshot 2022-08-28 9 03 11 PM

plugin:obsidian-git:10399 Uncaught (in promise) Error: Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
wenlzhang commented 1 year ago
  1. If you use Git from the command-line or another app, and you have a GitHub SSH key set up, you need to switch your remote URL from HTTPS to SSH.

This worked for me.

Vyeche commented 1 year ago

In my experience, this isn't an Obsidian Git problem, it just means authentication isn't set up.

There are two paths forward:

  1. If you use Git from the command-line or another app, and you have a GitHub SSH key set up, you need to switch your remote URL from HTTPS to SSH.
  2. Otherwise, you need to cache your Git credentials. I haven't done this, but I can include some links to pages that might help below (no guarantees).

Solved my issue: Caching your GitHub credentials in Git - GitHub Docs