Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Extensions - Differences between Personal Repository and Central repository

I am new in git and I have some doubts: Which is the difference from initializing a repository as personal or as central?

I guess If I establish as central, all members of my team can access it. However, if I initialize as personal, I am the only I can access to it (other members of my team cannot access it). Am I right?

Could someone confirm me if i am right and what is the difference between personal and central repositories in git? and for central repository, what does bare mean?

like image 954
user304602 Avatar asked Oct 20 '13 18:10

user304602


2 Answers

The non-bare repository is the one developers use - it has a working copy checked out, i.e. the code is directly available.

In case of a bare repository all that's there is the contents of the .git folder. This is great for pushing/pulling to/from the repository but for obvious reasons not suitable to view the code directly or work on the code.

So, when you want to develop stuff you want a non-bare repository. When you want to push to another machine create a bare one there and push to it from your non-bare one. If you use e.g. GitHub you won't create that bare repository manually - you create it on the website (which usually creates a bare one internally and sets up access control) and then setup it as a remote locally (the address of the repository is displayed so you just need to copy&paste it).

like image 193
ThiefMaster Avatar answered Sep 30 '22 05:09

ThiefMaster


I consider the two states to be public and private.

Private.
Private is only for me. It's useful to have my code in the cloud, it's backed up and I can download it to any machine I use.

Public. Public is for sharing with other people ('collaborators') whose keys you've entered in the project.

like image 40
Michael Durrant Avatar answered Sep 30 '22 05:09

Michael Durrant