I uploaded my ~/.ssh/id_rsa.pub
to Bitbucket\'s SSH keys as explained, but Git still asks me for my password at every operation (such as git pull
).
As explained here, if you clone with SSH url, you don't need to enter username / password each time you push / pull. Check above answer by @manojlds
But if you want to clone with HTTPS and want to avoid entering username / password each time, you can store credentials into cache with below command:
git config --global credential.helper 'cache --timeout 3600'
where 3600 (seconds) means 1 hour, you may change it as per your requirement.
Step 1: Install git-credential-winstore
https://confluence.atlassian.com/bitbucketserver/permanently-authenticating-with-git-repositories-776639846.html
Step 2: git config --global credential.helper 'cache --timeout 3600'
This will store your password for 1 hour
I cloned the repository with HTTPS URL instead of SSH URL hence even after adding the SSH Key it was asking me for password on Bash Shell.
I just edited the ./.git/config
file and changed the value of url
variable by simply replacing the https://
to ssh://
E.g.
[core]
...
...
...
[remote "origin"]
url = https://<username>@bitbucket.org/<username>/<repository_name>.git
fetch = +refs/heads/*:refs/remotes/origin/*
...
...
...
Changed to:
[core]
...
...
...
[remote "origin"]
url = ssh://<username>@bitbucket.org/<username>/<repository_name>.git
fetch = +refs/heads/*:refs/remotes/origin/*
...
...
...