fatal: could not read Username for visualstudio.com Device not configured

4.7k views Asked by At

I get this error when trying to push to my remote repo via sourcetree:

Pushing to https://xxx.visualstudio.com/DefaultCollection/_git/xxx error: git-credential-sourcetree died of signal 5 fatal: could not read Username for 'https://xxx.visualstudio.com': Device not configured

How do I configure this in sourcetree?

I have a personal access token but I don't know how to give it to sourcetree.

I'm on mac.

2

There are 2 answers

0
BeniaminoBaggins On

I had to delete the repo in sourcetree and clone it to sourcetree using an existing remote git url (which is not how I got it into sourcetree initially). Once this is done, then Sourcetree will add your user credentials. Not really sure on the details such as why it works but at least it works, so it might be able to help others in that situation.

0
ned13 On

I am using VSTS and encountered this problem after upgrade sourcetree. I tried to use gitflow to finish release, then the error message is:

fatal: could not read Username for 'https://xxxx.visualstudio.com': Device not configured
Fatal: Could not fetch release/xxxx from origin.

I solved this problem by following steps:

  1. Update my system git to newest version 2.17.1 in my case. Please refer to https://www.atlassian.com/git/tutorials/install-git
  2. Set up git-credential-osxkeychain helper according to https://www.atlassian.com/git/tutorials/install-git#install-the-git-credential-osx
  3. git clone same repository which I have problem.
  4. Do gitflow finish release again, it works without any error message.

Hope these steps can help someone has same problem with me.