You can do a normal git clone
, or you could do a complete duplicate/mirror that is exactly like the repo you're cloning with
git clone --bare https://github.com/project/example.git
This makes an exact duplicate that copies all the same refs /notes/ but no remote tracking. If you want that as well, then you do:
git clone --mirror https://github.com/project/example.git
The main differences is that --mirror
sets up remote tracking, and whatever changes the repo you're mirroring from will be reflected in that mirror copy, it will overwrite it's own refs if needed, this is great for making multiple exact copies of the repo.
More info on duplicating/mirroring a repository here and well as how to properly mirror a git repository