Skip to content

Instantly share code, notes, and snippets.

@alexej-d
Last active December 6, 2017 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexej-d/e6cdd6f4ec21391e582b6d829e79611f to your computer and use it in GitHub Desktop.
Save alexej-d/e6cdd6f4ec21391e582b6d829e79611f to your computer and use it in GitHub Desktop.
Sync changes on remote environment to local directory
ssh user@server.com "cd PROJECT_DIR; git status -s" | awk '{print $2}' | sed 's/\(.*\)/rsync -cav user@server.com:\/full\/path\/to\/PROJECT_DIR\/\1 .\/\1/' | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment