You can do this very efficiently in your current repo:
Starting from:
# ...---o---H HEAD, master
do
git cat-file -p master
| sed '1,/^$/d'
| git commit-tree HEAD^{tree}
| xargs git branch public
to get
# ...---o---H HEAD, master
#
# H' public <-- H's exact content and commit message, no history
Then,
git merge -s ours public
# ...---o---H---I HEAD, master <-- gives later merges an accurate base
# /
# H'' public
git remote add public -t public its://u/r/l # <-- '-t public` sets default push
git push public
and you're done.
(edit: added -t public
safety play so you have to do something explicit to push non-public history)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…