28

FYI this is specifically for sourcetree I am having this error when pulling in sourcetree, it was working just fine yesterday but it suddenly had this error.

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks fetch origin
remote: Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead.
remote: Please see https://github.blog/2020-07-30-token-authentication-requirements-for-api-and-git-operations/ for more information.
fatal: unable to access 'https://github.com/London-Foster/frontend.git/': The requested URL returned error: 403

I tried having a personal access token and use it on source tree but still was not able to login.

Bon Andre Opina
  • 2,129
  • 2
  • 15
  • 33
  • 3
    Does this answer your question? [Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead](https://stackoverflow.com/questions/68191392/password-authentication-is-temporarily-disabled-as-part-of-a-brownout-please-us) – Narann Jun 30 '21 at 10:10
  • Partially but I was lost on source tree set up posting this to help some having issues in source tree set up – Bon Andre Opina Jun 30 '21 at 12:45

7 Answers7

81

1 - Generate a new token from git dev settings

2 - In SourceTree, you just need to change your repository settings there:

enter image description here

enter image description here

3 - Change the URL/Path with the new format:

https://<USERNAME>:<TOKEN>@<GIT_URL>.git

enter image description here

4 - Press OK and it is good now!

probitaille
  • 1,899
  • 1
  • 19
  • 37
  • 2
    This doesn't seem very safe to have the password/token visible like that. Did anyone find an alternative? (tools->options->auth->edit->basic-token didn't work for me) – Samuel Aug 23 '21 at 13:05
  • 7
    The problem sometimes is that SourceTree stores your password information in a file and does not update it. In Windows, go to C:\Users\\AppData\Local\Atlassian\SourceTree. Edit the "passwd" file and remove the line with the account that your trying to change the password for. Save the file and retry on SourceTree. It should ask you for your credentials again. – Edrean Ernst Sep 29 '21 at 07:42
  • 2
    @EdreanErnst Excellent. On macOS the old password was still present in the Keychain Access. – Martin Braun Oct 14 '21 at 18:58
  • This didn't entirely work for me because I'm a member of an "organization" that has enabled SSO. I got an error like this. I had to visit the URL and try again, then it worked. organization has enabled or enforced SAML SSO. To access remote: this repository, visit https://github.com/orgs//sso?authorization_request=ATGTCIZD2VLSBGKNPYVUCK3C2IEXZA5PN5ZGOYLONF5GC5DJN5XF62LEZ remote: and try your request again. – atom88 Jul 15 '22 at 23:47
  • I cannot upvote this enough, the only way to get it to work. – kaiser Nov 11 '22 at 23:09
28

in source tree > open repo settings > remotes tab > edit the remote "URL/path" to be

https://{personal-access-token>@github.com}/{<my-repo>}.git>

then save and try to push

i did like @heratyian answer and works fine.

Ebrahim Sayed
  • 321
  • 2
  • 7
10

Step by step using the terminal and github

  1. Remove repo
git remote remove origin
  1. Generate personal access token https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

  2. Add remote back using personal access token

Remember to replace <personal-access-token> and <my-repo> with your credentials.

git remote add origin https://<personal-access-token>@github.com/<my-repo>.git>
heratyian
  • 414
  • 3
  • 13
  • 1
    Thanks for that, but now when I go to edit my remote, I can see my PAT in the origin URL. isn't that a security issue? – T Nguyen Jan 14 '22 at 08:06
  • what is that for a company Atlassian allowing such security issue. this is unbelievable – Emil Apr 26 '22 at 16:38
7

If on Windows, open the Credentials Manager and delete your github credentials if any.

If on macOS, open the Keychain Access app and delete your github credentials if any.

Then, get a Personal Access Token by following the guide here https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token

Then push your code as normal and when asked enter your newly generated personal access token.

DoritoStyle
  • 103
  • 2
woland
  • 416
  • 3
  • 7
3

I went: Tools>Options>Authentication. Edited my account.

I changed Authentication from Basic to OAuth. And now the brownout no longer affects me.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Will Lewis
  • 31
  • 2
1

After setting up my PAT and setting up my account in Sourcetree menu -> Preferences -> Accounts, I still got the brownout error. Adding your account in SourceTree seems to prompt for a password upon opening.

I set up git to cache my credentials: https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git

Then in SourceTree I re-cloned my repo. Got prompted for a password - entered my PAT. Now it's working fine.

webhead
  • 99
  • 7
0

I have solved the issue, just to ad up on woland's comment.

First add a personal access token then add it in your credentials Second add a remote by clicking the gear settings then add a remote Add the remote of your repository then link it with your account that has logged personal access token. lastly fetch to that remote origin.

Bon Andre Opina
  • 2,129
  • 2
  • 15
  • 33