I think it was discussed a lot but you could use expect. Here is an example of using it to connect to host using ssh:
#!/usr/bin/expect
set password "YOURPASSWORD"
set user "john"
set host "192.168.1.100"
spawn ssh $user@$host
expect "Password:"
send "$password\n";
interact
Replace "ssh user@host" with your command you want to execute, e. g. "git pull":
spawn git pull
The next line tells which prompt to expect ("Password:"). Make sure this string is set to exactly what appears after you manually do git pull. Case sensitivity and spaces are important.
EDIT: installing expect is easy, on Debian-based systems:
apt -y install expect
on RedHat-based:
yum -y install expect