Cloning git repo with all refs

I’m trying to get all refs from an external repository when cloning. I exported them all before, by doing push --mirror, so the external repository should have them, as far as I know.

How can I force all refs to be pulled?

  • Is it possible for a mirrored git repo miss commits?
  • ! errors after mirroring a git repository
  • How can I keep a git mirror in sync (including deleting branches)?
  • Does Github auto backup our projects into globally spread mirrors, like SourceForge?
  • Mirror team foundation server 2015 git repo to bitbucket
  • how to sync a repo mirror to a new upstream repo
  • Automatically mirroring a GitHub repo
  • How to set up a local directory for mirroring a remote git repository?
  • One Solution collect form web for “Cloning git repo with all refs”

    git fetch --tags
    

    should be enough to get all branches, and all tags from your remote mirror bare repo.

    -t
    --tags
    

    Most of the tags are fetched automatically as branch heads are downloaded, but tags that do not point at objects reachable from the branch heads that are being tracked will not be fetched by this mechanism.
    This flag lets all tags and their associated objects be downloaded.

    Git Baby is a git and github fan, let's start git clone.