Run the command below:
git clone --mirror <repo_source_path>
The --mirror
flag maps all refs (including remote-tracking branches, notes etc.) and sets up a refspec configuration such that all these refs are overwritten by a git remote update
in the target repository.