Using 1&1 IONOS git repository for website deployment
For host name, type the host name displayed in IONOS (e.g. home.xxxxxxxxx.1and1-data.host). The ssh username is the same as the main FTP user. This is the only username that has ssh access.
cd ~
mkdir lib
cd lib
nano post-receive.sh
Copy code from post-receive.sh
, and after saving make sure the post-receive.sh
script is executable by running: chmod +x post-receive.sh
mkdir repositories
cd repositories
git init --bare my_repo.git
cd my_repo.git/hooks
nano post-receive
Inside pase this code:
#!/bin/sh
. ~/lib/post-receive.sh
And make sure the post-receive hook script is executable:
chmod +x post-receive
git clone ssh://[email protected]/~/repositories/my_repo.git
git remote add origin ssh://[email protected]/~/repositories/my_repo.git
Find your deployed code here: ~/www/[repo_name]/[branch]