2

Can someone please give me the details on

git clone or git clone --mirror

Thanks. I am trying to make backups of my github repos and I am using it in a script.

I don't know what the difference is and I need someone to help me with the backups.

michaeltwofish
  • 4,096
  • 3
  • 28
  • 32
JohnNY
  • 539
  • 1
  • 3
  • 9
  • Possible duplicate of [What's the difference between git clone --mirror and git clone --bare](http://stackoverflow.com/questions/3959924/whats-the-difference-between-git-clone-mirror-and-git-clone-bare) – ghigad Oct 20 '15 at 15:02

1 Answers1

0

--mirror

Set up a mirror of the source repository. This implies --bare. Compared to --bare, --mirror not only maps local branches of the source to local branches of the target, it 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.

You'll get a bare repository, with all branches. This is what you want for a backup.

Jakob Borg
  • 23,685
  • 6
  • 47
  • 47