0

I have read articles but still not understand when and where a bare Git repository is used? I am working on a project. For which use-case can I create another project with a bare repository and what will be the benefit of it?

Is the only benefit that I can see logs?

Articels I read so far:

tafaust
  • 1,457
  • 16
  • 32
Nits
  • 520
  • 6
  • 21
  • 2
    Might be a similar question (explains what are the use cases for a bare repo) https://stackoverflow.com/questions/5540883/whats-the-practical-difference-between-a-bare-and-non-bare-repository – clamentjohn Aug 17 '18 at 06:28
  • Thanks! Basically it take less space .. etc and using for supervision no need to run code only view the logs, patch, commit, push and pull.. – Nits Aug 17 '18 at 12:26

1 Answers1

0

A bare git repository is a a repository without a working directory. It is basically only the .git folder of your regular git repository without the checked out files that you can edit.

It is useful for repositories on a server, where no work should be happening in that repository. That means a directory that is not used for editing files, building your project or running tests.

It reduces the amount of disc space needed and still permits cloning, pushing, pulling and fetching (probably more I forgot about). It does not work well for add and commit, because it has no working directory.

FlyingFoX
  • 3,379
  • 3
  • 32
  • 49