Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using git in my development environment. When I run the command "git pull origin master" is there any way to pass the pass-phrase from the command line.

share|improve this question

1 Answer 1

You should be using an agent for this so that you only need enter your passphrase once.

share|improve this answer
I followed the link and included the password in my ssh agent. Now, I am able to run the command "git pull origin master" and I am able to update my code base. The problem is if my put that command in a shell script and try to execute the script I am getting the following error. Permission denied (publickey). fatal: The remote end hung up unexpectedly My Shell script contains the following lines su nanda -c "cd /var/www/vhosts/; git pull origin master" Is anything I am missing here ? – Supratik Oct 5 '10 at 12:32
@Supratik: Access to an agent is restricted to the user that started the agent (via permissions on the named socket in the SSH_AUTH_SOCK environment variable). The pull running as nanda can not access your agent. You might be able to use the referenced keychain script (which has since moved to funtoo and github) to maintain an agent for your nanda user. Or, pull under your user and let nada access a local “clone” repository, or maybe give nanda an unencrypted key (ick) that can access origin. – Chris Johnsen Nov 23 '10 at 10:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.