alonbilu / git-ftp

A shell script for pushing git tracked changed files to a remote host by FTP.

Home Page:http://www.youtube.com/watch?v=JDGune5M4Yw

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README of git-ftp

This is free and open source software. If you like and use it, flattr it (flattr?). Thx.

Summary

Use git-ftp to upload only the files to a FTP server, which have changed since the last upload. This saves time and bandwith.

About

I use git-ftp for my script based projects, mostly PHP. Most of the low-cost web hoster does not provide SSH nor git support, only FTP.

That is why I needed a easy way to deploy my git tracked projects. Instead to transfer always the whole project, I thought, why not only transfer the files which changed since the last time, git can tell me those files.

Even if you are playing with different branches, git-ftp knows which files are different. No ordinary FTP client can do that.

Known Issues

Installing

See INSTALL file.

Usage

$ cd my_git_tracked_project
$ git ftp push ftp://host.example.com/public_html --user <user> --passwd <password>

For interactive password prompt use:

$ git ftp push ftp://host.example.com/public_html -u <user> -p

Pushing the first time needs option --force or -f because it will not find any deployed sha1 hash

Testing and Help

For testing mode use --dry-run alias -D

$ git ftp push ftp://host.example.com/public_html --dry-run -u <user> -p

For more options see man page or help:

$ git ftp help

Using Defaults

Setting defaults for a git project in .git/config

$ git config git-ftp.user john
$ git config git-ftp.url ftp.example.com
$ git config git-ftp.password secr3t

After setting defaults, push to john@ftp.example.com is as simple as

$ git ftp push

Using Scopes

For using defaults for different systems, use the so called scope feature.

$ git config git-ftp.<scope>.<(url|user|password)> <value>

Here I set the params for the scope "foobar"

$ git config git-ftp.foobar.url ftp.testing.com:8080/foobar-path
$ git config git-ftp.foobar.password simp3l

Push to scope foobar alias john@ftp.testing.com:8080/foobar-path using password simp3l

$ git ftp push -s foobar

Because I didn't set the user for this scope, it takes the user "john" as set before in defaults.

Contributions

Don't hesitate to use GitHub to improve this tool. Don't forget to add yourself to the AUTHORS file.

About

A shell script for pushing git tracked changed files to a remote host by FTP.

http://www.youtube.com/watch?v=JDGune5M4Yw

License:GNU General Public License v3.0