0

I want to add post-receive hook to my own git server that will copy newly pushed files to a remote FTP server.

I was looking at git-ftp with post-receive sample but the repository is not updated for a long time. Also its requirement "Requirements: git-python 0.3.x" is no longer valid link.

I have found another repo - git-ftp. However, this is also not updated recently and it seems to be used for something else than post hooks.

Is there any existing solution?

My current post-hook (based on Understanding Git Hook - post-receive hook)

#!/bin/bash

BRANCH="master"

while read oldrev newrev ref
do
    if [[ "${ref}" = "refs/heads/${BRANCH}" ]];
    then
        echo "Deploying master branch to production..."

        #here I want to upload newly pushed/commited files to remote FTP server

    else
        echo "Ref ${ref} received. Do nothing: only the master branch can be deployed"
    fi

done
Martin Perry
  • 9,232
  • 8
  • 46
  • 114

0 Answers0