How can I stop SourceTree from using a deleted account to try to connect to GitHub
Asked by Mark Schaschke:

I entered my account details in SourceTree for 2 accounts. The first was set as the default. I could browse repositories using both accounts, however I could not clone any from the second (non-default) account. I deleted the first account and made the second default, however I still have the same problem.

It goes like this - when I select the repository from my list of accessible github repos (it lists them all fine), and return to the 'Clone Repository' screen, the Source Path / URL field has a notice under it: 'This is not a valid source path / URL'. When I click on the 'details' button I get a dialog with:

ERROR: Permission to \<repo\>.git denied to \<username\>.

fatal: The remote end hung up unexpectedly

ERROR: Permission to \<repo\>.git denied to \<username\>.

fatal: The remote end hung up unexpectedly

abort: repository git@github.com:\<repo\>.git not found!

ERROR: Permission to \<repo\>.git denied to \<username\>.

fatal: The remote end hung up unexpectedly

Where \<username\> is the first (and now deleted) user and \<repo\> is the repo I selected from the list.

I am also getting 2 'GitHub API call failed' dailogs popping up every time I try to browse my repositories, both with the same content: 'The operation couldn't be completed. (SDNetDomain error 7.)' - not sure if this is related.

Thoughts?

Thanks,

Mark


Answers:
author: ??????? ????????
body: 2018. But I have the same issue


author: stevestreeting
body: Those errors are normal when you have a GitHub account in the list where the login credentials are incorrect.

However, I can't replicate the issue you have here - I tried creating extra GitHub accounts for which I didn't have the passwords (my friends, so they won't be annoyed by the failed logins!), and got the errors you described. However, I just removed these from the accounts list afterwards and the errors disappeared again, as expected.

Are you sure you confirmed the Edit Accounts dialog with OK after you'd removed the GitHub account?

comments: author: Mark Schaschke
body: Hi Steve,

Thanks for your response. I have definitely removed the original GitHub account. I also tried removing all the accounts and starting again, with the same result. I wonder if it is something to do with the failing account being the first one added.

I've completely uninstalled the product (removing all the Library/\[Caches\|Preferences\|...\] folders I can find), and re-installed, it has no knowledge of any of my accounts, but it is still trying to authenticate with that old username. Very strange. It's also strange that it's using the correct credentials to retrieve the list of repos, but a different set of credentials to clone a specific repo.

Oh hang on, I think I know what it is - I've been using git on the command line and have given GitHub my key. It's trying to use that, which of course doesn't have access to the other user's repo...


author: Chandresh Sanghavi
body: Bit late on this.. but needing help.. this error is weird. I can click Remote on Source tree and can go to Remote repository successfully.. I have been getting this error from yesterday since upgrading to 3.4.6.0 .. followed everything .. but still getting error

-uninstalled and reinstalled sourcetree  
-changed password  
-removed entries from credential manager and reset it from Authentication tab

Still no luck !!  


Tags: git