I\'m using BitBucket with Xcode and Git for version control, and recently I changed all of my passwords (thanks Adobe!).
Unsurprisingly, I\'m no longer able
Tried everything but nothing worked. Then the following did work.
I had the same problem, and the accepted answer didn't help me because the password wasn't stored in the keychain. I typed:
git pull https://myuser@bitbucket.org/mypath/myrepo.git
Then console asked me for my new password.
If your credentials are stored in the credential helper, the portable way to remove a password persisted for a specific host is to call git credential reject
:
$ git credential reject
protocol=https
host=bitbucket.org
⏎
or
$ git credential reject
url=https://bitbucket.org
⏎
After that, to enter your new password, type git fetch
.
For MAC users, using git GUI (Works for Sourcetree, may work for others as well). Would like to add a small remark to Derek's answer (https://stackoverflow.com/a/45703718/7138492). The original suggestion:
$ git config --global --unset user.password
should be followed by a push/pull/fetch BUT it might not work when done from the GUI. The %100 working case would be to do the very first consecutive prompt-triggering git command from console. Here is an example:
$ git config --unset user.password
$ git push
Then it will ask you to provide the new passoword.
For Mac
If you have multiple remote repositories (Github, Bitbucket, Job, etc.)
1) run in the project directory
git config --unset user.password
2) run remote git command (ie. git push or git pull)
Git will prompt you to reenter your user.name and user.password for this repository
Or you can do it globally if you have only one remote repository
git config --global --unset user.password
my password was good in github desktop preferences but wrong in the .git/config file
for me the only working solution was to manually edit the file: .git/config
that contains this line: url = https://user:password@github.com/user/repo.git
change password to the GOOD password because it was an older one for me