I git push
my work to a remote Git repository.
Every push
will prompt me to input username
and password
. I would like to avoid it for every push, but how to configure to avoid it?
gitgit-pushgithub
I git push
my work to a remote Git repository.
Every push
will prompt me to input username
and password
. I would like to avoid it for every push, but how to configure to avoid it?
Best Answer
1. Generate an SSH key
Linux/Mac
Open terminal to create ssh keys:
For Windows
(Only works if the commit program is capable of using certificates/private & public ssh keys)
Here is a walkthrough on putty gen for the above steps
2. Associate the SSH key with the remote repository
This step varies, depending on how your remote is set up.
If it is a GitHub repository and you have administrative privileges, go to settings and click 'add SSH key'. Copy the contents of your
~/.ssh/id_rsa.pub
into the field labeled 'Key'.If your repository is administered by somebody else, give the administrator your
id_rsa.pub
.If your remote repository is administered by your, you can use this command for example:
scp ~/.ssh/id_rsa.pub YOUR_USER@YOUR_IP:~/.ssh/authorized_keys/id_rsa.pub
3. Set your remote URL to a form that supports SSH 1
If you have done the steps above and are still getting the password prompt, make sure your repo URL is in the form
as opposed to
To see your repo URL, run:
You can change the URL with:
[1] This section incorporates the answer from Eric P