I'm trying to push my commits to my Bitbucket repository from Visual Studio 2017, and a window opens where it asks for my credentials. I'm pretty sure they're correct and I'm able to log in via browser. How do I fix this?
-
Do the answers on https://stackoverflow.com/questions/51757837/visual-studio-2017-with-bitbucket-terminal-prompts-disabled help? – Jim Redmond Aug 23 '18 at 19:18
-
No, I did that and some other things first. Didn't seem to be the reason why it wasn't working in my case. – user1306322 Aug 23 '18 at 19:18
2 Answers
Atlassian (company which develops Bitbucket) has changed their authentication some time ago, and so you must enter your email address now instead of your account name to log in. You may need to log into your Bitbucket account via browser and create/update to an Atlassian account.
Additionally, if your repository is configured to log in with your username, and the authentication window appears with your account name already typed into the first input field, you'll need to remove it from your git config (in your repository's .git\config file) like so:
https://AccountName@bitbucket.org/AccountName/project1.git
change to
https://bitbucket.org/AccountName/project1.git
Next time you try to push, the authentication window shows up with both fields empty, enter your email address and password, and it should work.
- 8,561
- 18
- 61
- 122
-
The email address is only used if you log onto bitbucket.org in your browser. It is not used in Git or Mercurial remote URLs. – Jim Redmond Aug 23 '18 at 19:16
-
I can't explain why it worked for me but it did and I wanted to document this on SO at least for my future self when I inevitably have this problem again. – user1306322 Aug 23 '18 at 19:17
As of today (Jul 21, 2022), when you try to push changes to git remote from the "Git changes" window in Visual Studio, it opens up a login screen which does not have OAuth.
So instead, if you open up the Terminal (CTRL + `) and try to push it from there using git push, it will open up a different login screen which has OAuth.
Not sure why this is the behavior, but that's how it is in the current date, and I'm guessing its going to be changed in the future.
Old
Bitbucket now has a feature called App Passwords for authentication purposes. You can create a new App Password and use that to login to bitbucket to commit your changes. Your username will remain the same
Similar issue is mentioned here as well.
- 5,193
- 4
- 30
- 59
-
Yes, for some reason today bitbucket wouldn't sync with my vsCode despite normally working. Typing git push in terminal prompted the terminal to ask for my password, which then restored the normal functionality. – richardprocter Jun 08 '23 at 17:12