项目作者: git-ftp

项目描述 :
Uses Git to upload only changed files to FTP servers.
高级语言: Shell
项目地址: git://github.com/git-ftp/git-ftp.git
创建时间: 2013-04-17T06:54:46Z
项目社区:https://github.com/git-ftp/git-ftp

开源协议:GNU General Public License v3.0

下载


Git-ftp — uploads to FTP servers the Git way

If you use Git and you need to upload your files to an FTP server,
Git-ftp can save you some time and bandwidth by uploading only those files that
changed since the last upload.

It keeps track of the uploaded files by storing the commit id
in a log file on the server. It uses Git to determine which local
files have changed.

You can easily deploy another branch or go back in the Git history to upload
an older version.

  1. # Setup
  2. git config git-ftp.url "ftp://ftp.example.net:21/public_html"
  3. git config git-ftp.user "ftp-user"
  4. git config git-ftp.password "secr3t"
  5. # Upload all files
  6. git ftp init
  7. # Or if the files are already there
  8. git ftp catchup
  9. # Work and deploy
  10. echo "new content" >> index.txt
  11. git commit index.txt -m "Add new content"
  12. git ftp push
  13. # 1 file to sync:
  14. # [1 of 1] Buffered for upload 'index.txt'.
  15. # Uploading ...
  16. # Last deployment changed to ded01b27e5c785fb251150805308d3d0f8117387.

If you encounter any problems, add the -v or -vv option to see more output.
The manual may answer some of your questions as well.

Further Reading

Limitations

  • Windows and OS X: I am very limited in testing on Windows and OS X. Thanks
    for helping me out fixing bugs on these platforms.
  • git-ftp as deployment tool: git-ftp was not designed as centralized
    deployment tool. While a commit is being pushed and uploaded to the FTP
    server, all files belonging to that revision must remain untouched until
    git-ftp has successfully finished the upload. Otherwise, the contents of the
    uploaded file will not match the contents of the file referenced in the
    commit.

Contributions

Don’t hesitate to improve this tool.
Don’t forget to add yourself to the AUTHORS file.
The core functionality is unit tested using shunit2.
You can find the tests in tests/.

This application is licensed under [GNU General Public License, Version 3.0]

[GNU General Public License, Version 3.0]:
http://www.gnu.org/licenses/gpl-3.0-standalone.html