cd /opt/myapp && git pull --ff-only origin main && sudo systemctl restart myapp

Category: VPS Management

cd /opt/myapp && git pull --ff-only origin main && sudo systemctl restart myapp

Pull latest code and restart the service

The minimal deploy loop: fast-forward pull the main branch (--ff-only refuses merges, so a diverged local tree fails loudly instead of creating a mess), then restart the systemd unit to load the new code. In one line it updates, verifies, and applies. For compiled apps, add the build step between pull and restart.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.