научи
git init
git add .
git commit -m "ooops"
git checkout -b production
Сливаем себе ветку production, пушить будем в неё.
git clone ssh://123.123.123.123/home/ubuntu/app
Идём на сервак, и
git checkout master
Создаём хук, в whereisapp/.git/hooks/post-receive выглядит так, свои путя проставь:
#!/bin/sh
cd ..
env -i git merge production
sudo systemctl restart app
Вот этот app это юнит в системд. Лови приблизительный конфиг:
[Unit]
Description=App
After=network.target
[Service]
Type=simple
PIDFile=/home/ubuntu/app/app.pid
WorkingDirectory=/home/ubuntu/app
ExecStart=/home/ubuntu/app/bin/app
ExecStop=/bin/kill -INT $MAINPID
User=ubuntu
Group=ubuntu
Restart=always
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target