Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This is a git post-receive hook that "deploys" code to your working tree using native git commands, edit as needed.
post-receive#!/bin/sh
###
# This file will deploy code from the repository into the
# specified web-root.
#
# File name: post-receive
#
# Instructions:
# 1. Uncomment and edit the lines below as needed
# 2. Save the file in the folder hooks/
# 3. Make the file executable by typing the following at the terminal:
# chmod +x hooks/post-receive
#
### Section 1: Git Work Tree
#
# Change the path to match your deployment root.
#
# GIT_WORK_TREE=/path/to/your/web-root git checkout -f
### Section 2: Create Zip File
#
# GIT_WORK_TREE=~/git-play-web-root-two git checkout -f
# git archive master --prefix='project/' --format=zip > `git describe master`.zip
# scp -r myzip.zip me@myhost.com:/full/path/
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.