Skip to content

Instantly share code, notes, and snippets.

@hawx
Created August 18, 2014 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawx/16d0d380fcf022851e45 to your computer and use it in GitHub Desktop.
Save hawx/16d0d380fcf022851e45 to your computer and use it in GitHub Desktop.
Create git repos on a server with post-update hook setup
#!/usr/bin/env sh
REPO=$1
mkdir /opt/git/$REPO.git
git init --bare /opt/git/$REPO.git
cd /opt/git/$REPO.git
mv hooks/post-update.sample hooks/post-update
chmod a+x hooks/post-update
git update-server-info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment