44 Initializing Bare Repositories

Most Git repositories that you work with have both the repository metadata (the files located in the .git/ directory) and a working tree (the files that you interact with). Repositories that are meant to pushed to and pulled from, however, are generally created as bare repositories—repositories that don’t have a working tree.

You use a bare repository to push your changes to. You generally need only one, but you can have as many as your situation might require. For example, you might need to create two, each one on different servers, so a different set of people can access it. You need to make sure to remember to push to both repositories, though.

Using these repositories helps you separate the ...

Get Pragmatic Guide to Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.