I build my static website locally with Hugo and use rsync to copy the files to my server. Here’s the command I use:
rsync -avz --delete -e 'ssh -p {server-port}' {local-directory}/ {username}@{server-ip}:{remote-directory}/
{username}: Your server’s username.{server-ip}: The IP address of your server.{local-directory}: The path to your site files on your machine.{remote-directory}: The target path on your server.- The
--deleteflag ensures that files removed locally are also deleted on the server, keeping both directories in sync.