Skip to content

Instantly share code, notes, and snippets.

@samuelckaufman
Last active December 13, 2015 17:48
Show Gist options
  • Save samuelckaufman/4950549 to your computer and use it in GitHub Desktop.
Save samuelckaufman/4950549 to your computer and use it in GitHub Desktop.
%.git.push: %.git
cd $*.git && git fetch origin && git push github 2>&1 >> ~/github.log
%.git:
[ -e $*/config ] || git clone --mirror git@private-git-host:$* \
&& cd $*.git && git remote add --mirror=push github [email protected]:PrivateOrganization/$*
#put this Makefile in github_mirror@yourserver:~/repos/
#Then copy the following 2 lines into private-git-hosts's post-receive hook for the repo:
#GITDIRNAME=pwd | perl -w -ne 'my ($dir) = reverse split(/\//); print $dir'
#ssh github_mirror@yourserver "cd repos && make $GITDIRNAME.push"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment