Obsidian Git Error

In Obsidian mac I was getting the following error when the Git Obsidian plugin tried to interact with the Repo.

fatal: could not read Username for ‘https://github.com’: Device not configured

Although it works fine using the Github Desktop app, the command line requires a Personal Access Token. The Plugin is using the Command line in teh background.

To Fix this I performed the following steps.

  1. Open Github Desktop and make sure you have no commits to push. Push them if you do.
  2. Remove the local Repo from Github Desktop and make sure you delete the files as well.
  3. Open a Terminal and setup the Repo again this time using your Personal Access Token.

Cloning the Obsidian Repo with your Personal Access Token

In the Terminal of your choice.

Sign in to your Github account. Go to your settings page and look for Developer Settings.

Choose Personal Access Tokens -> Tokens (Classic).

At the top of the screen choose Generate new Token and for Obsidian the Classic token is fine.

Sign in with MFA if you have it configured.

In the configuration screen fill a name into the Note field. ObsidianToken is what I went with.

Set an expiry date. I set a Custom date of 1 year from now. You can set it to not to expire but this is not recommended.

Set the OAuth scope. In this case Repo is enough.

It’s worth familiarising yourself with the rest of the options but for now this is enough for Obsidian.

Then at the bottom of the page choose Generate Token

IMPORTANT!

Next you must copy the token and put it somewhere safe. The Blue copy button next to the token will copy it to memory. I have my Obsidian login credentials saved in a password manager and that has a note field so I chose to put it in there. Choose somewhere safe you will remember

Use the git clone command to clone the Obsidian Repo. Should be something like.

git clone https://gitbub.com/UserName/Obsidian/Obsidian.git

Note to do this you only need to be in the root of where your Git repos are, the clone command creates a subdirectory for that Repo.

Enter your UserName

When challenged for your password, paste in the Personal Access Token.

Now reopen Obsidian and if you were sure to put your Obsidian repo in the same place as before it should just work.

Leave a Reply

Your email address will not be published. Required fields are marked *