0

This question about bash scripting.

I'm not familiar with bash, but I have script that updates all repositories

#!/bin/sh
echo UPDATING Client 1
echo ==========================================
cd /var/www/html/client1
git pull
/usr/bin/php symfony goodwin:update
echo Updating SITE
cd /var/www/html/client1/site
git pull
/usr/bin/php symfony goodwin:site-update
echo ------------------------------------------
echo Client 1 UPDATED: `date "+%H:%M:%S  %d-%m-%Y"`
echo ------------------------------------------...
echo UPDATING Client 2
echo ==========================================
cd /var/www/html/client2
git pull
/usr/bin/php symfony goodwin:update
echo ------------------------------------------
echo Client 2 UPDATED: `date "+%H:%M:%S  %d-%m-%Y"`
echo ------------------------------------------

So I need to put git password for every git pull command - it is really inconvenient.

Is there any tricks for bash how to send password only once or set it in command line?

Thank you in advance!

webbear
  • 379
  • 1
  • 4
  • 11
  • That is not the same. I don't need to store password. I need to enter it once while I'm making update keep it in bash scope and use it for pull. – webbear Jun 22 '15 at 12:29
  • Why do you feel that bash is the correct answer? The problem is that Git is prompting for a password each time not bash. The only way to stop Git from asking is described in the [duplicated thread](http://stackoverflow.com/questions/7773181/git-keeps-prompting-me-for-password) – Sukima Jun 22 '15 at 12:36

0 Answers0