41

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

Rahul Yadav
  • 2,627
  • 5
  • 30
  • 52
  • Have you checked this https://confluence.atlassian.com/bitbucketserver/permanently-authenticating-with-git-repositories-776639846.html – Smit Mar 03 '17 at 17:22
  • @Smit I haven't used any of the methods given there – Rahul Yadav Mar 03 '17 at 17:35
  • Are you using the [Git Credential Manager](https://github.com/Microsoft/Git-Credential-Manager-for-Windows) at both home and work? If you are at work, it should remember. (link has information about where passwords are stored). – crashmstr Mar 03 '17 at 18:00

4 Answers4

58

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.

Rahul Yadav
  • 2,627
  • 5
  • 30
  • 52
21

With the default configuration of git on windows, this is stored in Windows under: control panel => User => Credential manager.

See a more details answer here

Cadoiz
  • 1,446
  • 21
  • 31
Philippe
  • 28,207
  • 6
  • 54
  • 78
10
sudo cat ~/.git-credentials

If you have saved credentials locally, will yield
https://<USERNAME>:<PASSWORD_OR_TOKEN_IN_USE>@github.com

Bazer Con
  • 105
  • 4
Gabriel Petersson
  • 8,434
  • 4
  • 32
  • 41
3

In my case git config credential.helper was empty (local and global both). Turns out the credentials were stored in KWallet. Those are found in KWalletManager under ksshaskpass (even though I am using HTTPS auth for this particular repo) under "Passwords".

Atmaks
  • 391
  • 3
  • 14