Skip to content

Instantly share code, notes, and snippets.

@thbkrkr
Last active February 12, 2016 17:20
Show Gist options
  • Save thbkrkr/d37ea4a4f912286ceb9b to your computer and use it in GitHub Desktop.
Save thbkrkr/d37ea4a4f912286ceb9b to your computer and use it in GitHub Desktop.
Prepare git repo with push and update
# curl -sSL https://gist.github.com/thbkrkr/... | sh -s ops.git
repo=$1
[ ! -d $repo ] \
&& mkdir $repo && cd $repo \
&& git init && git config receive.denyCurrentBranch ignore \
&& echo '#!/bin/sh' > .git/hooks/post-receive \
&& echo "GIT_WORK_TREE=$repo git checkout -f" >> .git/hooks/post-receive \
&& chmod u+x .git/hooks/post-receive \
|| echo "$repo is ready"
@thbkrkr
Copy link
Author

thbkrkr commented Jul 5, 2015

curl -L git.io/gitpush | sh -s "mydir"

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