What is a bare repository in GIT?

preview_player
Показать описание
Q. What is a bare repository in GIT?

A repository created with git init –bare command is a bare repository in GIT.

The bare repository does not contain any working or checked out copy of source files. A bare repository stores git revision history in the root folder of repository instead of in a .git subfolder.

It is mainly used for sharing and collaborating with other developers.

We can create a bare repository in which all developers can push their code.

There is no working tree in bare repository, since no one directly edits files in a bare repository.

Q. How do we put a local repository on GitHub server?

To put a local repository on GitHub, we first add all the files of working directory into local repository and commit the changes. After that we call git remote add Remote Repo URL command to add the local repository on GitHub server.

Once it is added, we use git push command to push the contents of local repository to remote GitHub server.

Learn more GIT interview questions, join our popular GIT Interview Questions Preparation Course with more than 100 questions for $10 only today!!

Рекомендации по теме
Комментарии
Автор

Bro, I have question about git bare repository, just say I am new person to the development team, and I want start my developing code wich is available in centralized git bare repo, so how could I edit the file in order to make the changes, as well as how can I push the changes to remote git bare repo.

palanisamy-dlqe