Skip to content

Instantly share code, notes, and snippets.

@navasvarela
Created September 6, 2012 09:31
Show Gist options
  • Save navasvarela/3653789 to your computer and use it in GitHub Desktop.
Save navasvarela/3653789 to your computer and use it in GitHub Desktop.
Deploy using git
#!/bin/sh
# Post update hook to be added to the dir.git repository
# This hook pulls the master from the repo into the working web app git repo
echo
echo "Pulling changes into deployment repository"
echo
git --git-dir /path/to/webapp/dir/.git --work-tree /path/to/webapp/dir/ pull origin master
#!/bin/bash
# From http://sebduggan.com/blog/deploy-your-website-changes-using-git/
# These are the commands that need to be executed to initialise the two repositories that are needed to deploy an app, the main repository and
# the one that holds the application
mkdir $1.git
cd $1.git
git init --bare
cd ..
git clone $1.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment