opjsvq
Last Updated: February 25, 2016
·
412
· celc
Ebc47ee771e1695743e6b79c0821f37f

FTP files recently committed to Git

ftp

Ocassioanlly new client has old hosting only accessible over FTP and wants us to perform changes before we've had a chance to migrate them.

git diff 38cfe001a9885cb68bdc42a049d431a920606285..aa64bdf818f0552473288d09487cebe0ba3919dd --name-only --relative --diff-filter=MC |\
xargs -I % curl -u username:password -T % ftp://example.org/public_html/%

This gets us new or modified files in a range, relative from the current path:

git diff sha1..sha2 --name-only --relative --diff-filter=MC

Pipe to xargs and upload with curl, into the target directory.

xargs  -I % curl -u username:password -T % ftp://example.org/public_html/%

No more directory traversal to copy over the 10 files you changes spread over the filesystem.

Say Thanks
Respond

2 Responses
Add your response

15315
A08afa742b1f086414e68af6f7e7a6b0
over 1 year ago ·
15317
Ebc47ee771e1695743e6b79c0821f37f

Ah I like git-ftp, a combination of catchup and --syncroot should be able to accomplish what I usually need. I'll try it next time, thanks. :)

over 1 year ago ·