1

At my workplace I am trying to speed up my startup procedure so I am writing a BASH script that does it for me.

One of the things it needs to do is do multiple git pull commands

What I would like to do is have the script grab my password once at the very beginning, and then pipe that response into each git pull command.

However echo $password | git pull does not seem to do anything.

Is there a way to pipe into git pull, and if so how do I?

Adam
  • 11
  • 3
  • possible duplicate: http://stackoverflow.com/questions/4857702/how-to-provide-password-to-a-command-that-prompts-for-one-in-bash – zormit Feb 06 '15 at 23:55
  • what he's trying to do is a duplicate, but he shouldn't be using bash to do it when git provides its own mechanism to avoid repeated authentication. – Ben Grimm Feb 06 '15 at 23:57

1 Answers1

3

Don't do that - use gitcredentials and the cache credential helper:

git config credential.helper 'cache --timeout=300'
Ben Grimm
  • 4,316
  • 2
  • 15
  • 24