Created
January 22, 2013 19:03
-
-
Save zanematthew/4597331 to your computer and use it in GitHub Desktop.
This is a git post-receive hook that "deploys" code to your working tree using native git commands, edit as needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 [email protected]:/full/path/ | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment