Does a git clone/push/pull mirror the exact contents of the repos involved?

Viewed 903

I wasn't sure how to word the question, so apologies if it's not clear. If you git clone a repo that had a bunch of dangling objects, do you clone those? Same for the opposite. If you did a git gc and pushed that to someone else, does their repo lose anything the git gc would have cleaned up?

I would guess that neither of these would occur, but I can't find any documentation on this scenario.

I found some information that seems to imply that with most protocols git clone gives you a clean repo, but if you specify the file using a file path it copies everything.

The main reason to specify the file:// prefix is if you want a clean copy of the
repository with extraneous references or objects left out.
1 Answers
Related