Created
January 5, 2017 16:21
-
-
Save themorgantown/16dc248c45ce3cfc0e3d17cbdfbf0451 to your computer and use it in GitHub Desktop.
Sync a local folder with SFTP or FTP server using git-ftp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment