Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I perform a `git pull` without re-entering my SSH password?

Is it possible to configure git/ssh so I don't have to enter my passphrase every time I want to perform a git pull? Note that the repo is a private one on github.

Or, alternatively, what would be the best practice to automate code deployment from a private Github repo?

Additional details: EC2 instance running a public AMI based on Fedora.

like image 733
jldupont Avatar asked Jun 07 '11 13:06

jldupont


People also ask

How do I disable password prompt when doing git push pull?

Issue the command git fetch/push/pull. You will not then be prompted for the password.

Does git pull use SSH?

However, if you want to use other Git functionalities (such as push, pull, clone, etc), you will need to access your server through SSH. You need Master Credentials to run Git commands because Application Credentials do not have permission to generate and access SSH keys (stored in the default location).


2 Answers

Have a look at this link https://help.github.com/articles/working-with-ssh-key-passphrases/

But I don’t want to enter a long passphrase every time I use the key!

Neither do I! Thankfully, there’s a nifty little tool called ssh-agent that can save your passphrase securely so you don’t have to re-enter it. If you’re on OSX Leopard or later your keys can be saved in the system’s keychain to make your life even easier. Most linux installations will automatically start ssh-agent for you when you log in.

like image 188
Fredrik Pihl Avatar answered Oct 21 '22 05:10

Fredrik Pihl


I enabled the password caching as described here:

https://help.github.com/articles/caching-your-github-password-in-git/#platform-linux

To cache the password for a month:

git config --global credential.helper 'cache --timeout=2628000' 
like image 45
Sileria Avatar answered Oct 21 '22 05:10

Sileria