Last active
December 13, 2015 17:48
-
-
Save samuelckaufman/4950549 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%.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