Skip to content

Instantly share code, notes, and snippets.

@elazdins
Created August 24, 2016 12:10
Show Gist options
  • Save elazdins/b6cb9568139750c167d6fe3c9987ee03 to your computer and use it in GitHub Desktop.
Save elazdins/b6cb9568139750c167d6fe3c9987ee03 to your computer and use it in GitHub Desktop.
Pull in latest FTP changes from a remote server and create a new git branch based on them
#! /bin/bash
now=$(date +"%d-%m-%Y")
cd /path/to/local/project
git checkout master
git pull remote master
git branch $now
git checkout $now
lftp -e 'set ssl:verify-certificate no; mirror -P 10 -v /remote/folder/ /path/to/local/project/.' -u username,password FTP_SERVER_IP
git add -A
git commit -m 'latest changes from the remote server'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment