I want to clone a repo, and I want the clone to have all the tags from the original. I can do this manually like so
$ git clone --mirror https://github.com/{org}/{SourceProjectName}.git
$ cd {SourceProjectName}.git
$ git push --mirror https://github.com/{org}/{ProjectName}
It seems libgit2sharp is the best way to do this, but if there's a better way let me know.
I don't understand how to do it with libgit2sharp It seems I have to do a clone, then somehow copy refs Then I have to iterate over all of those refs and stage them all... then commit? I started working on doing all this but it feels like I'm re-inventing the wheel...
Where I looked so far:
- https://github.com/libgit2/libgit2sharp/issues/577
- https://libgit2.org/docs/guides/101-samples/#repositories_clone_mirror (I didn't understand this well enough to translate to c#)