I would like to know the efficient way one person from my team could completely understand an unknown git repository from scratch (i.e. i don’t provide them any detail) ?
Take the situation depicted herebelow
How could a person from my team quickly and efficiently know the complete structure of the repository ?
How can he know that two branches exist ?
How can he know the reasons of these two branches ? (assuming they will never be merged and will stay as is)
I am asking because it seems that to efficiently retrieve branches, one must first know that they exist. Or does cloning the entire repository and then do a git log is the right answer ?
3
You simply need to clone the repository, then do git branch --list
(or just git branch
) on your local machine to list out the branches.
When you clone a repository in git, you always get the complete history, including all branches.
As for knowing the reasons for the branch, git doesn’t manage that. It’s up to your team to manage the reasons for creating a branch. For example, you might want to require that the initial commit always includes a reason, or a link to a ticket in a ticket tracking system, or a link to a story in a story tracking system.