I use plink.exe for automatisation of git commands and this works fine. But i need to use this with servers with login of sudo
plink.exe -ssh [email protected] -m commands.txt
my commands.txt file for example:
echo -e "MYPASSWORD\n" | sudo -S -i
cd /home/www/argentium.ru
git checkout HEAD~3
and output looks like loged in, but git executes as if it works without login of sudo:
[sudo] password for argentium: fatal: Unable to create '/home/www/argentium.ru/.git/index.lock': Permission denied
With help putty.exe works fine
сentos-7-x86_64-minimal @ 23.11.2016
-bash-4.2$ sudo -i
[sudo] password for argentium:
[root@stilnoeserebro ~]# cd /home/www/argentium.ru
[root@stilnoeserebro argentium.ru]# git checkout HEAD~3
Note: checking out 'HEAD~3'.