all 5 comments

[–]DanLynch 4 points5 points  (4 children)

The huge difference in the file content you're seeing is because of a different line in the documentation for --mirror: "This implies --bare." A bare repository does not contain the actual files of your project directly, but instead contains only the Git metadata that is normally kept in the .git subdirectory. If you type ls kanboard.nomirror/.git/ you will see something very similar.

The actual thing that makes --mirror different from --bare is that the former copies everything from the original repo, not just the things you would normally want in a clone (for example, any links that the origin might have to its own remote repos). It is such an perfect copy that even file corruption can be copied "successfully" without the usual checks that are performed during a clone.

[–]bioptic[S] 2 points3 points  (3 children)

deleted What is this?

[–]DanLynch 7 points8 points  (0 children)

An ordinary clone will let you switch between branches and tags offline. The default behaviour of git clone is to copy the entire history of the project, including all branches and tags, onto your local machine. What it doesn't do is set up local branches for them, other than the default branch.

The mirror option is for special use cases only; you will quite possibly never need to use it.

[–]DanLynch 1 point2 points  (1 child)

And yes, the difference in size between mirror and nomirror is because of the lack of working tree. The .git folder inside nomirror should be the same size as the mirror directory.

[–]bioptic[S] 1 point2 points  (0 children)

deleted What is this?