Git Push into Production (FTP)

I would like to know if there is an easy way to push a GIT repository into production (on a FTP server) ? Thanks


Solution 1:

Some tools recently added to the Git wiki:

git-ftp by René Moser is a simple shell script for doing FTP the Git way. Use git-ftp.sh to upload only the Git tracked files to a FTP server, which have changed since the last upload. This saves time and bandwith. Even if you play with different branches, git-ftp.sh knows which files are different. No ordinary FTP client can do that.

git-ftp by Edward Z. Yang is a simple script written in python for uploading files in a Git repository via FTP, only transferring new files and removing old files.

Solution 2:

If you prefer GUI, use SourceTree, you can easily setup a Custom Action that uses git-ftp mentioned above. A brief description on setup (for Mac) at Push a Git repository to an FTP

enter image description here

Solution 3:

I've found PHPloy a great tool for sending your Git commits to remote servers over FTP. It works from the command-line and is written in PHP (and even detects changes in submodules).

https://github.com/banago/PHPloy‎

git commit ...
phploy -s staging
phploy -s production

Done!

(Disclaimer: after using it for a while I've now contributed some code patches and improvements, making it Windows-compatible.)