Source tree fix for git Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead [duplicate]
Asked Answered
R

7

29

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.

Raymundorayna answered 30/6, 2021 at 9:21 Comment(2)
Does this answer your question? Password authentication is temporarily disabled as part of a brownout. Please use a personal access token insteadHeindrick
Partially but I was lost on source tree set up posting this to help some having issues in source tree set upRaymundorayna
H
84

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!

Headwards answered 30/6, 2021 at 17:39 Comment(6)
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)Cohdwell
The problem sometimes is that SourceTree stores your password information in a file and does not update it. In Windows, go to C:\Users\<username>\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.Neogaea
@EdreanErnst Excellent. On macOS the old password was still present in the Keychain Access.Beekeeping
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. <your> organization has enabled or enforced SAML SSO. To access remote: this repository, visit github.com/orgs/<MY_ORG>/… remote: and try your request again.Emigrate
I cannot upvote this enough, the only way to get it to work.Trauner
you are a gentleman and a scholar!Heti
C
30

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.

Conjuration answered 30/6, 2021 at 18:50 Comment(0)
H
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>
Hibernal answered 30/6, 2021 at 18:30 Comment(2)
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?Hammerfest
what is that for a company Atlassian allowing such security issue. this is unbelievableSetaceous
H
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.

Humectant answered 30/6, 2021 at 9:38 Comment(0)
C
3

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

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

Cantus answered 30/6, 2021 at 18:29 Comment(0)
G
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.

Gab answered 30/6, 2021 at 18:47 Comment(0)
R
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.

Raymundorayna answered 30/6, 2021 at 9:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.