Skip to content

Instantly share code, notes, and snippets.

@arnold-almeida
Last active December 19, 2015 23:28
Show Gist options
  • Save arnold-almeida/6034424 to your computer and use it in GitHub Desktop.
Save arnold-almeida/6034424 to your computer and use it in GitHub Desktop.
Sync only new/changed files from a current dir over ssh to a remote folder.
  • New deployment

rsync -azv --stats --progress . -e ssh user@host:/path/to/vhost/ --exclude=".git" --exclude-from=".gitignore"

  • Notice bad code, locally revert changes, or fix and commit.

git reset --hard HEAD@SHA1

  • Sync working copy again

rsync -azv --stats --progress . -e ssh user@host:/path/to/vhost/ --exclude=".git" --exclude-from=".gitignore"

#!/bin/bash
rsync -azv --stats --progress . -e ssh user@host:/path/to/vhost/ --exclude=".git" --exclude-from=".gitignore"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment