Github is about to cut me off from my Digital Ocean server next week, it seems I am using the wrong email, I have tried all the suggestions on Stack Overflow and nothing seems to work.
So I have my BitBucket account as [email protected], I can access BitBucket and generate an app password, no problem.
However when I push to Git, I still get the warning message "You are using an account password for Git over HTTPS etc"
The problem appears to be that I am pushing to Git with the wrong credentials.
My Bitbucket account is [email protected]
, but I am pushing to git using [email protected]
and then pulling Git to my server using [email protected]
.
When I started remote working for Nxxxd
, I had to use [email protected]
to push to their Git account, and my MacBook Air still uses this for git even though it should be using [email protected]
for Git.
Every attempt to get rid of [email protected]
in Git or on my Mac seems to be ignored by Git: I want to push to git using [email protected]
and the new app password - any suggestions?
CodePudding user response:
If you are using HTTPS, the wrong credentials are probably cached in your credential storage.
Check the value, from the local repository folder, of
git config credential.helper
xxx
Then, using a BitBucket HTTPS access token from the right account rxxr, store the token for that server:
printf "host=bitbucket.org\nprotocol=https\nusername=rxxr\npassword=BitBucketToken" | \
git-credential-xxx store
Check it has stored the right value with:
printf "host=bitbucket.org\nprotocol=https\nusername=rxxr" | \
git-credential-xxx get
You next push will use the right credentials.
CodePudding user response:
@VonC was almost right and helped with the new credentials, once I removed the old credentials it resolved. This required the lines:
git config --system --unset credential.helper
git config --global --unset credential.helper