Jul 17, 2022
0
Level 10
git hook with shh config
hello , I connect in digital ocean server with this ssh config -
Host my_host
User root
Port 22
Hostname 123.123.111.222
IdentityFile ~/.ssh/digital_ocean
TCPKeepAlive yes
IdentitiesOnly yes
then In my machine I make the command to connect to the host -
ssh my_host
then it will connect .
but , now I have created a git hook . I need to connect with my hook -
git remote add production ssh://[email protected]/var/repo/app.git
then I manke the command -
git push production
And will not connect , becose my server will ask for the ssh key . there is any way to associate the ssh config to the git hook ? do something like that -
ADD SSH CONFIG TO PRODUCTION -
Host my_host_production
User root
Port 22
Hostname 123.123.111.222/var/repo/app.git
IdentityFile ~/.ssh/digital_ocean
TCPKeepAlive yes
IdentitiesOnly yes
and then the hook -
git remote add production my_host_production
then git push production
there is any way to do something like that ?
Please or to participate in this conversation.