DEV Community

Discussion on: Git cheatsheet for beginners

Collapse
 
bersbersbers profile image
bersbersbers

I stopped reading here:
"repository keeps all your project's files, including commits and branches.

branch is a copy of the repository ..."

So the repository holds copies of itself?

Collapse
 
duomly profile image
Duomly

I would say yes, without going deep into "how git works inside", when you create a new branch, you create a new version, something like copy of code from the branch which is the parent for your new branch.

Collapse
 
bersbersbers profile image
bersbersbers

A copy of a branch, yes. But not a copy of the whole repository (which would be impossible, since copying the whole repository into itself would be subject to recursion).

en.wikipedia.org/wiki/Russell%27s_...