Skip to content

Instantly share code, notes, and snippets.

@mcgaffin
Last active August 29, 2015 14:13
Show Gist options
  • Save mcgaffin/936ee5da26733a42af11 to your computer and use it in GitHub Desktop.
Save mcgaffin/936ee5da26733a42af11 to your computer and use it in GitHub Desktop.
Deploy only changed files to ftp
# submitted by a user via intercom: https://app.intercom.io/a/apps/hb7wi6ch/inbox/unassigned/conversations/681962001
mkdir ~/clone/git_clone
mkdir ~/clone/changes_only
cd ~/clone/git_clone
git clone https://username:password@repo
cd ~/clone/git_clone/repo
tar cf - $(git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $COMMIT_ID) | ( cd ~/clone/changes_only; tar xpf -)
lftp -c "open -u $FTP_USER,$FTP_PASSWORD 31.186.174.218; set ssl:verify-certificate no; mirror -R ~/clone/changes_only/ /remote_dir"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment