Git Push into Production (FTP)
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
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.)
Solution 4
If you're on a mac and have Transmit, I'd recommend the following git-tranmit script (https://gist.github.com/379750). It uses DockSend to send only the last updated files. If you're not familiar with DockSend, check out http://www.panic.com/blog/2010/11/15-secrets-of-transmit/.
Setup:
- cp git-transit /usr/sbin/.
- cd /usr/sbin
- chmod +x git-transmit
- Setup drop send for your live app
- Run git-transmit in your git repository.
Solution 5
You could use Deployhq.com it works like a charm, the only thing you need to do is to set up your repository and FTP account.
They currently the following version control systems:
Git, Subversion, Mercurial.
With repository hosted
- GitHub
- Bitbucket
- GitLab
- Codebase
Comments
-
Roch almost 2 years
I would like to know if there is an easy way to push a GIT repository into production (on a FTP server) ? Thanks
-
d11wtq almost 14 yearsWell, git can be leverage pretty well for this purpose in reality. Check out the tag and create post-checkout, post-merge etc hooks to handle any installation procedures needed. We used to use RPM packages but after moving to git it was simply overkill.
-
dodgy_coder almost 12 yearsThe only problem with this is when you don't have access to the production server, i.e. it might be simple shared hosting, with only FTP access.
-
gang over 11 yearsusing git-ftp, is there a way to push just a subdirectory (e.g. the publish folder of html5 boilerplate) to the specified ftp directory?
-
Shmygol over 10 yearsAnd what if there are several developers in the team. Is it still possible to use this scripts?
-
Pranav 웃 over 10 years@Trilliput : A little late here, but yes, an intermediate server/vm on the network as the place where everyone pushes, and then : github.com/ezyang/git-ftp#using-a-bare-repository-as-a-proxy
-
quickshiftin over 10 yearsThis script is rather clumsy about selecting 'last updated files'. Check out this fork for a more elegant solution.
-
Simon East about 10 yearsgithub.com/banago/PHPloy also does a similar thing but works with submodules, which I suspect some of the mentioned tools might struggle with.
-
indianwebdevil over 8 yearsThe main problem with git-ftp (not sure script or python) I tried it was very bad when uploading large chunks of files and long list of files.
-
borisdiakur about 8 yearsIn addition to that you may want to transmit only tracked and uncommited files. Here’s a tiny script which does just that: gist.github.com/borisdiakur/37b8f512f6f8865b79c7
-
Dave Thompson over 7 yearsI posted this answer prematurely. FTPloy is not quite 'production ready' and there are a lot of bugs. I couldn't get it to work. I am using DeployHQ which works very well.
-
Geri Borbás over 7 years@Julix For the article mentioned.