Skip to content

Instantly share code, notes, and snippets.

@bjdixon
Last active May 7, 2018 05:23
Show Gist options
  • Save bjdixon/e001ae3d07c1278a06c25e439cb5cbe7 to your computer and use it in GitHub Desktop.
Save bjdixon/e001ae3d07c1278a06c25e439cb5cbe7 to your computer and use it in GitHub Desktop.
build a list of scp commands for all changed files. Could | sh instead of > ./scp_changed to just invoke the scp commands instead.
git status --porcelain | awk '{if($1!="D") {print "scp " $2 " host:/var/www/host_dir/" $2 } }' > ./scp_changed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment