Skip to content

Instantly share code, notes, and snippets.

@jjn1056
Forked from samuelckaufman/Makefile
Created February 20, 2013 17:40
Show Gist options
  • Save jjn1056/4997396 to your computer and use it in GitHub Desktop.
Save jjn1056/4997396 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