• Stars
    star
    494
  • Rank 89,130 (Top 2 %)
  • Language
    Python
  • Created over 16 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A quick and efficient way of pushing changed files to a website via FTP

git-ftp.py: quick and efficient publishing of Git repositories over FTP

Introduction

Some web hosts only give you FTP access to the hosting space, but you would still like to use Git to version the contents of your directory. You could upload a full tarball of your website every time you update but that's wasteful. git-ftp.py only uploads the files that changed.

Requirements: git-python 0.3.x
it can be installed with easy_install gitpython

We also have a PPA which you can install with sudo add-apt-repository ppa:niklas-fiekas/ppa and then sudo aptitude install git-ftp.

Usage: python git-ftp.py

Note: If you run git-ftp.py for the first time on an existing project you should upload to the hosting server a git-rev.txt file containing SHA1 of the last commit which is already present there. Otherwise git-ftp.py will upload and overwite the whole project which is not necessary.

Storing the FTP credentials

You can place FTP credentials in .git/ftpdata, as such:

[master]
username=me
password=s00perP4zzw0rd
hostname=ftp.hostname.com
remotepath=/htdocs
ssl=yes

[staging]
username=me
password=s00perP4zzw0rd
hostname=ftp.hostname.com
remotepath=/htdocs/staging
ssl=no

Each section corresponds to a git branch. FTP SSL support needs Python 2.7 or later.

Exluding certain files from uploading

Similarly to .gitignore you can specify files which you do not wish to upload. The default file with ignore patterns is .gitftpignore in project root directory, however you can specify your own for every branch in .git/ftpdata:

[branch]
... credentials ...
gitftpignore=.my_gitftpignore

Used syntax is same as .gitignore's with the exception of overriding patterns, eg. **!**some/pattern, which is not supported Negations within patterns works as expected.

Using a bare repository as a proxy

An additional script post-receive is provided to allow a central bare repository to act as a proxy between the git users and the ftp server.
Pushing on branches that don't have an entry in the ftpdata configuration file will have the default git behavior (git-ftp.py doesn't get called). One advantage is that users do not get to know the ftp credentials (perfect for interns).
This is how the workflow looks like:

User1 --+                          +--> FTP_staging
         \                        /
User2 -----> Git bare repository -----> FTP_master
         /                        \
User3 --+                          +--> FTP_dev

This is how the setup looks like (One ftpdata configuration file, and a symlink to the update hook):

root@server:/path-to-repo/repo.git# ls
HEAD  ORIG_HEAD  branches  config  description  ftpdata  hooks  info  objects  packed-refs  refs
root@server:/path-to-repo/repo.git# ls hooks -l
total 0
lrwxr-xr-x 1 root    root      29 Aug 19 17:17 post-receive -> /path-to-git-ftp/post-receive

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

htmlpurifier

Standards compliant HTML filter written in PHP
PHP
2,837
star
2

ghstack

Submit stacked diffs to GitHub on the command line
Python
647
star
3

convolution-visualizer

Convolution visualizations
JavaScript
354
star
4

logitext

Beautiful, interactive visualizations of logical inference
UrWeb
144
star
5

compact

Compact regions library for Haskell
Haskell
82
star
6

nvprof2json

Convert nvprof profiles into about:tracing compatible JSON files
Python
67
star
7

torchdbg

PyTorch centric eager mode debugger
TypeScript
43
star
8

csrf-magic

Automatic CSRF protection for PHP applications
PHP
41
star
9

thesis

Thesis
TeX
37
star
10

pl-class-public

Public slides and assignments for CSCI-UA.04900: Special Topics in Programming Languages
JavaScript
36
star
11

stride-visualizer

Stride visualizations
JavaScript
36
star
12

cusec2012-victor

Transcript of "Inventing on Principle", CUSEC 2012 given by Bret Victor
34
star
13

ghc-shake

ghc --make reimplemented with Shake
Haskell
31
star
14

metromaps

Metro Maps as envisioned by Dafna Shahaf
HTML
28
star
15

lr-agda

Logical relations proof in Agda
Agda
23
star
16

onnx-pytorch

PyTorch development for onnx
Python
21
star
17

pytorch-unattached

Tensors and Dynamic neural networks in Python with strong GPU acceleration
C++
20
star
18

tlparse

TORCH_LOGS parser for PT2
Rust
19
star
19

SMT-LIB-benchmarks-pytorch-shapes

SMT-LIB benchmarks for shape computations from deep learning models in PyTorch
SMT
18
star
20

hpd3js

Haskell heap profiling with D3.js
JavaScript
17
star
21

backpack-examples

Backpack examples repository
15
star
22

eff

Inefficient and syntactically unwieldy implementation of algebraic effects in Python using generators
Python
14
star
23

ghc-rts-rust

A reimplementation of GHC's runtime system in Rust
Rust
14
star
24

deepseq-magic

Deep evaluation of data structures without NFData
Haskell
11
star
25

HoTT-coqex

Coq solutions to exercises in HoTT book
Coq
11
star
26

hamt

Hash Array Mapped Tries in Haskell
Haskell
11
star
27

ocaml-cminsketch

Count-min sketch implementation in OCaml
OCaml
10
star
28

hsleak

A collection of space leaks in GHC Haskell
Haskell
10
star
29

ghc-plugin-template

Sample project for GHC core transformation plugins
Haskell
9
star
30

stenomatic

The Stenomatic 9000: a Steno drilling tool
HTML
8
star
31

reflex-backpack

Reflex with Backpack
Haskell
8
star
32

backpack-regex-example

Regex example with Backpack
8
star
33

scheme-hamt

Hash-array mapped trie in mit-scheme
Scheme
8
star
34

jfp-ghc-rts

JFP article on the GHC RTS
8
star
35

ghc-usage

Frontend plugin to print locally used module info
Haskell
8
star
36

stg-spec

Specification of GHC's spineless tagless G-machine and its cost semantics
Makefile
7
star
37

tmr-issue24

Mini-issue of The Monad Reader!
Haskell
6
star
38

tmr-issue20

The Monad Reader: Issue 20
Haskell
6
star
39

nf

NF data type to statically enforce normal form
Haskell
6
star
40

mutsleuth

Mutation detection in Python
Python
5
star
41

hello-plugin

Hello World plugin using GHC API, intended for use with cabal/stack repl
Haskell
5
star
42

groom

Pretty-print Show instances from Haskell
Haskell
5
star
43

SensorSimulator

Sensor Simulator for simulating sensor data in real time.
Java
5
star
44

sake-bot

Bot for transmitting Travis build information upstream
Ruby
5
star
45

triemap

Matching and unification on TrieMaps
Haskell
4
star
46

tmr-issue22

Issue 22 of the Monad Reader
Haskell
3
star
47

hackage-query

Query Hackage for interesting information
Haskell
3
star
48

hoopl

Higher-order optimization library
Haskell
3
star
49

stenowiki

Wiki for steno dictionary entries
Python
3
star
50

breaking-barriers

Research repository for "breaking barriers"
TeX
3
star
51

sigc

Compare implementations with signatures, generate "implements" tables
Haskell
3
star
52

tmr-issue21

Issue 21 of The Monad Reader
Haskell
2
star
53

cpython-metaclass

metaclass in cpython extension
C++
2
star
54

automation

Shell
2
star
55

jpeg-raw-sync

Sync jpeg deletions to raw folder
Rust
2
star
56

rlimits

Support code for Haskell resource limits.
Haskell
2
star
57

ezyang.com

HTML files for my personal website
HTML
2
star
58

bake

Experimental GHC API driver for Backpack
Haskell
2
star
59

haskell-mit6005

Haskell to MIT 6.005 FP pseudocode pretty-printer
Haskell
2
star
60

labeler-github-action

Labeling GitHub action for PyTorch issues/pull requests
JavaScript
2
star
61

ghceye

Haskell
2
star
62

data-dependent-shape-puzzles

Puzzlers regarding data-dependent shapes in PT2
Jupyter Notebook
2
star
63

ghc-cafeteria

Eagerly evaluated all CAFs in your application
Haskell
2
star
64

pdfs

1
star
65

github-delete-old-branches

Delete old branches from GitHub
Ruby
1
star
66

flavr

Mobile website for flavor matching lookups (data not included)
Haskell
1
star
67

cachegrind-labs

some experiments using cachegrind to measure performance
C++
1
star
68

s3-bouncer

Gatekeeper for presigned S3 urls
Python
1
star
69

ci-experiments

CI experiments
1
star
70

hiw16-slides

Slides for Haskell Implementor's Workshop 2016
1
star
71

gh-magic-keywords

magic keyword experiment
1
star
72

stratify

Stratifies the lambda cube into multiple levels
Haskell
1
star
73

pldi14-rlimits-aec

Artifact evaluation for PLDI'14
Haskell
1
star
74

tmr-issue23

Issue 23 of The Monad Reader
TeX
1
star
75

model-tests

Model tests for PyTorch
Python
1
star
76

latency

Some latency benchmarks
Haskell
1
star
77

dividing-the-land

Answer Set Programming solution to Dividing the Land metapuzzle
JavaScript
1
star
78

vimrc

My vimrc
Vim Script
1
star
79

crepe

experimenting with puppeteer
JavaScript
1
star
80

circleci-experiment

testing for circleci
1
star