How to set app password in Git Bash (command prompt)
Asked by zaktan:

Hello!

Can anybody suggest - how to set Bitbucket app paaword into Git Bash client? I tried to set it just like "git config --global user.password=""" but it doesn't work. The warning from bitbucket is showing after every push.

In official documentation there is instructions only for SourceTree. Nothing about git Bash.

Thanks.


Answers:
author: vadiks93
body: Hi I tried several attempts / ways via git bash on windows 11,

reinstalled git bash, deleted / changed configs etc... none of these worked

I created the app password on Bitbucket as per indicated steps

and went to Control Panel -\> Credential Helper,

edit on git:<https://bitbucket.org> and set the app password,

after done this I committed and pushed a new change and did **not** receive anymore the warning

remote: You are using an account password for Git over HTTPS.  
remote: Beginning March 1, 2022, users are required to use app passwords  
remote: for Git over HTTPS.

Hope it helps

comments: author: Bec Wilson
body: This is great hear that you solved it. I have also tried many things, dozens. Can you explain in detail what you mean by:

1 - went to control panel -\> credential helper,

2 - edit on git:[https://bitbucket.org](https://bitbucket.org/) and set the app password

Thanks!!!


author: Bec Wilson
body: also in git .config did you set credential manager to wincred?


author: Norbert C
body: Hi [@Bec Wilson](/t5/user/viewprofilepage/user-id/4823971)

Please do the following steps:

- Click on Start button -\> Type "Credential Manager"

- Once you opened the Credential Manager, click on Windows Credentials -\> Search for git:<https://bitbucket.org>, click on the arrow -\> Edit

Please let me know how it goes.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: vadiks93
body: [@Bec Wilson](/t5/user/viewprofilepage/user-id/4823971) sorry for late response,

I did same as from Norbert

first added new app password from Atlassian by using this guideline

<https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/#Create-an-app-password>

then once created I used as from Norbert steps,

sorry it was Credential Manager and not helper


author: Leticia
body: Norbert's steps worked perfectly! Thanks so much!!


author: Norbert C
body: You're welcome [@Leticia](/t5/user/viewprofilepage/user-id/1004830) I'm glad to hear I was able to help :)


author: Norbert C
body: Hi [@zaktan](/t5/user/viewprofilepage/user-id/3337151) ,

Thank you for contacting Atlassian Community, I'm Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you.

To save the credentials in your computer, I can recommend you to do these steps:  

First run:

    git config --global credential.helper store

After you ran this command, please clone a repository by doing:

```
git clone https://yourusername@bitbucket.org/workspace/repository?
```

When you clone the repository, please provide your password, once you provided the password a \~/.git-credentials file should be present in your home directory. Please keep in mind, that this file is in plaintext on your PC's disk, everyone on your computer can access it.

Please let me know how it goes, I'm here to help.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: zaktan
body: Hi!

Is there a way without cloning repository? My repo is big and heavy and I don't need to download it, I already have it on my PC.

Also I've tried to make .git-credentials file myself with content format:

```
https://apppw_name:apppw_password@bitbucket.org/workspace/repository
```

but nothing works. Need help.  

P.S. and also when started to clone repository - no passwords was asked.


author: Norbert C
body: Hi [@zaktan](/t5/user/viewprofilepage/user-id/3337151)

I'd like to inform you that the .git-credential file is stored in your home directory (C:\\Users\\username\\.git-credential and the format is the following for the .git-credential file:

```
https://username:password@bitbucket.org
```

Also I'd like to inform you that instead of "git clone", you can also run the "git pull" command.

Before running the "git pull" command, can I ask you to access the "Credential Manager" in your Windows system and try to delete all the Git related credentials?

Please let me know how it goes.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: zaktan
body: Hi [@Norbert C](/t5/user/viewprofilepage/user-id/1190200)   
I'm the only one person who pushes commits to this repository. And because of this I have nothing to pull from it.

In my windows home directory I had the .git-credentials file, where was my bitbucket account username and password. I changed username to AppPassword Label and password to AppPassword itself. Is it right?

I suppose it isn't, cuz the warning in command line after push was showed again after this change.


author: Norbert C
body: Hi [@zaktan](/t5/user/viewprofilepage/user-id/3337151)

It's interesting.

Can I suggest you the following and let me know whether if it's working for you?

Please try to re-install your Windows Git client and once you have the following option, enable the "Git Credential Manager"

![gitcredentialmanager.png](https://community.atlassian.com/t5/image/serverpage/image-id/183196iE22F353348A2BFF6/image-size/large?v=v2&px=999 "gitcredentialmanager.png")

This way your credentials are stored safely in your the "Credential Manager" in your Windows environment.

Once you have this feature enabled, when you do a git push a window like this should pop up and here please provide your password, once you provide the password here, it should save the password in your Windows' Credential Manager

![asdf.png](https://community.atlassian.com/t5/image/serverpage/image-id/183197i941C7FEE7E11A077/image-size/large?v=v2&px=999 "asdf.png")

Please let me know how it goes.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: d4vidi
body: [@zaktan](/t5/user/viewprofilepage/user-id/3337151) you don't really have to reclone the repo. It appears that after providing the app password in the prompt following the *git clone* command, git would generate the proper content under the .git-credentials file; In my case, it was enough so as to make my existing clones operable as well.


Tags: atl-gruland

bash

bitbucket-cloud

cloud

password