简体   繁体   中英

How to git push using ftp?

I want to upload (using only 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

you can check roll-out . Rollout has the following features.

Atomic Deployment

It downloads the changes of your code in separate folder, till it completes downloading of all the files.

releases\v1\ releases\v2\ releases\v3\ current -> release\v3\

Once all the files are downloaded. It makes that folder as active version of your website. So its very transparent to user that nobody knew about any new versions/revisions.

Included batteries

Version Check:

It checks if the PHP Version on your hosting server matches your requirement. This is very important because Hosting servers doesn't inform you when they update PHP Versions on their servers. You may have forgotten to keep your development machines to match the php versions.

So Why Should we check the version?

Every versions of PHP includes new features, and depreciate lots of features and functions. For When your developed a website using PHP 5.3 and your hosting server has PHP 5.6. Chances are there the following features can break.

Here are the list of features/functions that are depreciated in the versions mentioned below.

  1. Features & Functions depreciated in PHP 5.5
  2. Features & Functions depreciated in PHP 5.6
  3. Features & Functions depreciated in PHP 7.0

Extension Check

rollout Analyse the code and pick out all the extensions used by your PHP codebase, and check if all those extensions are present on the server. If they are not present, rollout will alert you to install the extension. By checking these you avoid the risk of breaking of your code since that particular extension is not present and eventually you tend to avoid the risk of hours of debugging to analyse what went wrong in the hosting server.

Automatic Dependencies Installation

Just add composer.json rollout will automatically install all the dependencies mentioned in composer.json

PHP Linting:

rollout does automatic PHP Linting of the entire codebase looking for any errors. It would halt the installation, if rollout finds any php syntax error. This again helps in breaking of code on the hosting server.

Rollback is just a click away

After you deploy your code on the hosting server. If anything goes wrong, you can easily revert to previous version. Just at the click of a button.

Also rollout is completely free for open source projects or public repositories.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM