Skip to content

Instantly share code, notes, and snippets.

@themorgantown
Created January 5, 2017 16:21
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save themorgantown/16dc248c45ce3cfc0e3d17cbdfbf0451 to your computer and use it in GitHub Desktop.
Save themorgantown/16dc248c45ce3cfc0e3d17cbdfbf0451 to your computer and use it in GitHub Desktop.
Sync a local folder with SFTP or FTP server using git-ftp
# Instructions for syncing a local folder with a remote FTP or SFTP server
# The only requirement is homebrew. To get git-ftp:
brew update && brew install git-ftp
# Initialize a git repo in the directory you want to sync. Track all files, and commit them to your repo:
git init
git add -A && git commit -m "Committed all files"
# Set config options for your FTP server. These config options are added to the git repo:
git config git-ftp.user dangleshingle_tumulttest
git config git-ftp.url sftp://domain.net
git config git-ftp.password passwordhere
git config git-ftp.syncroot /Users/daniel/desktop/folder
git config git-ftp.insecure 0
# Upload files the first time:
git-ftp init --remote-root home/public/ -vv --syncroot /Users/daniel/desktop/folder
# after the files have been pushed once, updating requires this:
git add -A && git commit -m "Committed all files"
git-ftp push --remote-root home/public/ -vv --syncroot /Users/daniel/desktop/folder
#other options
#git config git-ftp.deployedsha1file mySHA1File
#git config git-ftp.insecure 1
#git config git-ftp.key ~/.ssh/id_rsa
#git config git-ftp.keychain user@example.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment