简体   繁体   中英

What is the difference between git clone and git clone --mirror?

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.

--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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM