开发者

How to git push using ftp?

开发者 https://www.devze.com 2023-03-03 11:46 出处:网络
I want to upload (using o开发者_如何学Pythonnly ftp) to my server only changes. I have a working git repository in my local. But I cant figure out any way to push using ftp.

I want to upload (using o开发者_如何学Pythonnly ftp) to my server only changes. I have a working git repository in my local. But I cant figure out any way to push using ftp.

I can use git push to send other hosting, beacuse it allow ssh, but this hosting only allows ftp.


The git-ftp script does exactly this:

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.


You should be able to push to a FTP repository using

git push ftp://host.net/path/to/repo.git/


I’ve written a little PHP script that heps with that. It si called PHPloy and is tightly-coupled with Git to determine what which files where edited/added/deleted and uploads them accordingly. You put your FTP details in a deploy.ini file and run just a command to deploy:

phploy

You can also deploy to multiple servers at once. And if you have multiple servers configured, you can select to deploy to one of them like this:

phploy --server staging

There is more that can be done – check it out on Github: https://github.com/banago/PHPloy

0

精彩评论

暂无评论...
验证码 换一张
取 消