What is a repository on Git?

A repository is this set of folders that is tracked and synchronized. Contributing to the repository means changing it: adding or removing files, or editing them.

Usually, the repository encompasses all the files related to a project. It’s thus connected to the highest-level folder of the project.

Git creates a subfolder called “git” within this high-level project folder. In this folder it stores all the modifications and changes that occur within the entire project folder. Deleting the “/git” folder means deleting the history of the repository… so you’d only be left with the project in its actual state, without ever being able to revert or document past changes!

In itself, deleting the /git folder shouldn’t crash the website or project.

Me again.

To sum it up, the repository is the project folder. There’s always a master folder which serves as a reference, and sometimes there are secondary folders (slaves, in the parlance). Changes among these are tracked by Git and written out in the /git folder on each device.

The difference with dropbox or other cloud-based storage folders is the following: Git enforces a stricter protocol to validate and attribute changes. In order for a change to take effect, the developer has to “commit” the change, otherwise Git simply won’t change anything. In addition, the repository owner has to validate the committed change, and merge it back to the master folder. That way, responsibility is traced and it’s easier to revert issues.

Sometimes repository is shortened and people talk of “repo” instead.