0

I am using git in my development environment.

When I run the command git pull origin master is there any way to pass the passphrase from the command line.

Bob Ortiz
  • 444
  • 4
  • 21
Supratik
  • 2,154
  • 10
  • 51
  • 66

1 Answers1

1

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

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • 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/apps.mydomains.com/subdomains/nanda/httpdocs/ib_test; git pull origin master" Is anything I am missing here ? – Supratik Oct 05 '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](http://www.funtoo.org/en/security/keychain/intro/) and [github](https://github.com/funtoo/keychain)) 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