Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time I want to push and/or pull from the terminal (in Linux) I have to enter a password. How do I remove this so that it pulls and/or pushes without the password?

share|improve this question
4  
What is the protocol used by your repo address? ssh? https? – VonC Sep 22 '11 at 8:10
up vote 19 down vote accepted

Generate a private/public key pair for password-less authentication.

For Linux, your keys are stored in ~/.ssh.

If you already have files in ~/.ssh that's named id_rsa and id_rsa.pub, then you already have a key pair. Append the contents of your public key (that's id_rsa.pub) to the Git repository's ~/.ssh/authorized_keys file.

$ scp ~/.ssh/id_rsa.pub user@git.repo:id_rsa.tmp
$ ssh user@git.repo
$ cat id_rsa.tmp >> .ssh/authorized_keys

If you don't have the key pair, generate one with

$ ssh-keygen -t rsa

Read this for further instructions: http://inchoo.net/tools-frameworks/how-to-generate-ssh-keys-for-git-authorization/

share|improve this answer
    
@slhck Ah, didn't think of that! It'll be good to know the OS whirlwin is using before posting further instructions, though. – Jin Sep 22 '11 at 8:17
    
Thanks for the pointer. I Have updated the question accordingly! – whirlwin Sep 22 '11 at 8:22
1  
When I run the first command I get a: You appear to be using ssh to clone a git:// URL. Make sure your core.gitProxy config option and the GIT_PROXY_COMMAND environment variable are NOT set. lost connection – MultiformeIngegno Apr 6 '13 at 0:38

You can also just change your passphrase and replace it by an empty string :
ssh-keygen -p

share|improve this answer
    
isn't this very wrong? as there will be no more security – titus Jul 26 '13 at 9:48
1  
awesome simple way. – Dineshkumar Jan 7 '14 at 10:34
1  
Thank you. This is the fix for people who have an SSH key setup but aren't sure why they still need to input a passphrase. – Cory Danielson Aug 19 '14 at 16:23

I had created a new branch and after that when I pulling, I had to enter the user name and password. Then I resolve the problem re-cloning the branch with ssh address (which is on the relevant repository site).

For example:

git clone git@github.com:sshare/GLE.git
share|improve this answer

Run

git config credential.helper store

This will store your credentials in a folder inside root. You need to run git pull/push after this command and give the user name/pwd for the first time. Post this it will not prompt for user/pwd. Details at https://git-scm.com/docs/git-credential-store

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .