Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How can I stop SourceTree from using a deleted account to try to connect to GitHub

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<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.




2 answers

2018. But I have the same issue

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?

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...

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 .. 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 !!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

6,440 views 5 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you