To make an exact duplicate, you need to perform both a bare-clone and a mirror-push.
[code language=”java”]
git clone –bare <reponame>
# Make a bare clone of the repository
cd <reponame>
git push –mirror <newreponame>
# Mirror-push to the new repository
[/code]