3

I'm using SourceTree and have 2 GitHub accounts. I connect and push my commits to one of them. First time SourceTree ask me to enter password, but when I wanted to push to my other GitHub account it doesn't ask me to enter the password and just show this error:

git error message: unable to access the repository

I couldn't find a way to change the password. I could push to the other site like GitLab, but I couldn't find a way to change the password for another GitHub account. What should I do?

Os: macOs Seirra

Lundin
  • 195,001
  • 40
  • 254
  • 396
Hamed Ghadirian
  • 6,159
  • 7
  • 48
  • 67
  • 1
    You have to set your different accounts github on your machine where you try to do commits. https://coderwall.com/p/7smjkq/multiple-ssh-keys-for-different-accounts-on-github-or-gitlab –  Sep 22 '17 at 11:14
  • @headmax I am not using ssh, I use https – Hamed Ghadirian Sep 22 '17 at 11:17
  • 1
    i am no talking about doing ssh commits i talk about how setting multi accounts on your machine and without any credential helpers defined, Git will try the following strategies to ask the user for usernames and passwords ... more https://git-scm.com/docs/gitcredentials –  Sep 22 '17 at 11:24
  • @headmax 1-It isn't possible to have multiple account without using ssh? 2-how can I remove my previous account and use new account with https? – Hamed Ghadirian Sep 22 '17 at 12:34
  • 1
    you can but the repository --bore the project.git must be on "local server" and pushing will be on this local without git authentification. when i talk about "local" i mean, your own domain. https://mydomain.git. –  Sep 22 '17 at 14:20
  • @headmax ok,TanX, I will try ssh – Hamed Ghadirian Sep 22 '17 at 14:37

4 Answers4

3

Under Tools > Options > Authentification you can edit your username

Crux lp
  • 166
  • 1
  • 12
3

you can change password for git-credential-sourcetree in Keychain Access

Haven Lin
  • 176
  • 1
  • 16
0

In new version of Sourcetree, new Account tab added to the preference.

enter image description here

Hamed Ghadirian
  • 6,159
  • 7
  • 48
  • 67
-1

In Windows, sometimes the answers provided by "Crux lp" and "Haven Lin" may not work. In that case, just go to "windows credential manager" then click on "Windows Credentials" and find your account in the list. Press on "Edit" and change your password.

amirfg
  • 272
  • 2
  • 6
  • 21