Skip to content

Instantly share code, notes, and snippets.

@janosgyerik
Last active December 18, 2015 04:19
Show Gist options
  • Save janosgyerik/5724915 to your computer and use it in GitHub Desktop.
Save janosgyerik/5724915 to your computer and use it in GitHub Desktop.
Create a mirror Git repository from an existing Git project directory for the purpose of release management using a post-receive hook
# go to the directory where the site is deployed
cd ~/project/dir
# initialize empty Git repo for release purposes
git init --bare ~/repos/git/releases/project.git
# add the repo as a remote called "releases"
git remote add releases ~/repos/git/releases/project.git
# create the "beta" branch locally and switch to it
git checkout -b beta
# push the release branch to the releases remote
git push -u releases beta
@ah0703
Copy link

ah0703 commented Jan 6, 2014

Line 13 should probably read: # push the beta branch to the releases remote

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment