问题
I have a git repository set up on bitbucket
$ git remote -v
origin https://myusername@bitbucket.org/myusername/my_repository_name.git (fetch)
origin https://myusername@bitbucket.org/myusername/my_repository_name.git (push)
I pull and push to the repository from my office workstation and home PC. When I push or pull from my office workstation, it prompts me for the password. However when I push or pull from my home PC it doesn't prompt for a password.
I don't specifically remember what I did on my home PC to remember the password.
running $ git config credential.helper
returns manager
$ git config credential.helper
manager
Contents .gitconfig
file in my user folder at root level
[user]
name = myusername
email = user.name@email.com
Where is the password stored on the local disk?
What is the command to check the status of current credentials?
How do I similarly remember the password on my office workstation?
Note: I am using Windows 7
回答1:
if $ git config credential.helper
returns manager
, the password is stored in the windows credential manager, if it returns store
, password is stored in a .git-credentials
file in the user folder.
回答2:
With the default configuration of git on windows, this is stored in Windows under: control panel
=> User
=> Credential manager
.
See a more details answer: https://stackoverflow.com/a/51437252/717372
回答3:
`sudo cat ~/.git-credentials`
If you have saved credentials locally, will yieldhttps://<USERNAME>:<PASSWORD_OR_TOKEN_IN_USE>@github.com
来源:https://stackoverflow.com/questions/42584934/where-is-my-remote-git-repository-password-stored-on-the-local-machine