May 21 in Git
Q: What is the bare Git repository? How is it different from a standard/non-bare Git repository?

1 Answer

May 21

Repositories that are created through git init command are the standard/non-bare Git repositories.

In the top-level folder of such repository, you will find two things:

A .git subdirectory keeping all metadata and track of the history of your repo.

A working tree.

The repositories which are created using git init –bare command are known as bare Git repositories. They are mainly used for sharing. They do not contain any working tree. They keep the git revision history of your repository in the root folder rather than having it inside the .git subfolder.

It just contains bare repository data. This is how a bare Git repository is different from a standard Git repository. Also, a bare repository does not have a default remote origin repository as it serves as an origin repository for multiple remote users.

Since a bare repository does not contain any workspace, the git push and git pull commands do not work over a bare repo. You are not required to commit any changes to a bare repo.

Click here to read more about GIT
Click here to read more about Insurance

Related questions

Feb 17 in Git
Oct 16, 2019 in Git
Oct 15, 2019 in Git