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
running git config --global --unset user.password
followed by any git command would prompt you to enter username and password.
git config --global --unset user.password
git push (will prompt you for the password)
git status (will not prompt for password again)
To fix this on macOS, you can use
git config --global credential.helper osxkeychain
A username and password prompt will appear with your next Git action (pull, clone, push, etc.).
For Windows, it's the same command with a different argument:
git config --global credential.helper wincred
None of the other answers worked for me on MacOS Sierra 10.12.4
Here is what I had to do:
git config --global --unset user.password
Then run your git command (ex. git push) and reenter your username and password.
you can change password through command line in 2 places, following would edit credentials to connect the repo
git config --edit
The credentials also can be changed at global using global parameter like below
git config --global --add user.password "XXXX"
or set the credentials helper with
git config --global credential.helper wincred
but if you have repo level credentials set the use the first command
git config --edit
Just clone one of your existing repos, this will prompt you for new credentials:
e.g.
git clone https://myuser@bitbucket.org/mypath/myrepo.git
// https://myuser@bitbucket.org/mypath/myrepo.git is an address of one of your existing repos.
There is such a confusion on this question, as there is way too much complexity in this question. First MacOS vs. Win10. Then the different auth mechanisms.
I will start a consolidated answer here and probably need some help, if I do not get help, I will keep working on the answer until it is complete, but that will take time.
Windows 10: | |--
MacOS:
|
|-- Using git config to store username and password:
| git config --global --add user.password
|
|---- first time entry
| git config --global --add user.password <new_pass>
|
|---- password update
| git config --global --unset user.password
| git config --global --add user.password <new_pass>
|
|-- Using keychain:
| git config --global credential.helper osxkeychain
|
|---- first time entry
| Terminal will ask you for the username and password. Just enter it, it will be
| stored in keychain from then on.
|
|---- password update
| Open keychain, delete the entry for the repository you are trying to use.
| (git remote -v will show you)
| On next use of git push or something that needs permissions, git will ask for
| the credentials, as it can not find them in the keychain anymore.