Any time I try to git pull or git push or almost anything else that isn't git status, I get the Atlassian Log in to your account that asks to either sign in with browser or use your bitbucket username and a token or password, as pictured.
If I choose to sign in with my browser, it authenticates, but it only lasts for that command. Any future command, it'll ask to sign in again with my browser. This is infuriating enough to try and use the other password/token issue.
So I try to set that up and build an API Token, which I'm told is the future-proof way of doing things, so I set that up, create an API Token which I plug in with my bitbucket username (not email address) and my new API Token. So I go and run git pull, and what greets me: The log in to your account pop up yet again.
I can see that my API Token is being hit, last accessed shows that it's being hit when I run git pull.
I'm on an intel imac, using VSCode 1.120.0 (Universal), the default zsh terminal option, but this also happens on the MacOS terminal too.
Is there any solution for this? Or is this just more about the living hell that is MacOS?
Hi @Lars Wyness
The issue is almost certainly that macOS Keychain isn't being used as your credential helper, so Git has nowhere to persist the token between commands. Run this in your terminal:
git config --global credential.helper osxkeychain
Then do a git pull one more time, enter your Bitbucket username and the app password, and Keychain should cache it from that point forward.
If that still doesn't stick, check whether you've got a conflicting credential helper configured at the repo level:
git config --show-origin --get credential.helper
One more thing — make sure you're using your Bitbucket username (not your email) with the app password.
The username is what you see at bitbucket.org/account/settings/ under "Bitbucket profile settings." The email address won't work for Basic Auth.
Thank you very much, this was definitely on the right track, but I found the better way to go was to set up a personal SSH key instead.
I did run into a small issue where when I logged in, I could give my Bitbucket username but it would ask for an app password and the Bitbucket UI tells me that app passwords are being deprecated and to use API tokens instead. I don't see a way to use API tokens instead, but perhaps I'm missing something.
Just for future reference, I think the answer is to generate an app password and use your Bitbucket username and app password to log in, but for me, personal SSH key is better since you can choose to never expire a key and set-and-forget.
Thanks so much for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.