Update - In comments on another answer, you requested documentation of git's behavior. That would be the git clone
docs (https://git-scm.com/docs/git-clone). If that's what you were actually asking for, you should've said so in your question instead of burying the real ask in a comment. That said, bear in mind that requests for documentation are off-topic and if you need git docs, they're all pretty easy to find by googling the relevant command.
does Git get all repository data in its index (including all commits from all branches) or does it get full history only for a master branch?
Well...
As for what you're trying to ask, by default clone
copies the full history of all branches. You can limit this behavior with options like single-branch
or depth
, but copying everything is the default.
However, your terminology is a bit of a problem. The index
is usually a single snapshot of the project, representing the content as it would be recorded by git commit
. (The exception is during merging, when it may store multiple states of files that are in conflict.) It is not where history is stored, and it is not what rev-list
consults.
So git does not "get all repository data in its index"; it gets the data in the local database.
Also, there may be additional information, beyond the histories of all branches, that is not fetched by default. But if the question is just about branches and their histories, then yes, everything is fetched.