public
Last active

  • Download Gist
Makefile
Makefile
1 2 3 4 5 6 7 8 9 10 11
%.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 git@github.com: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"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.