Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git central repository and Team

I have been playing around with GIT on my local computer.

As I have gain a bit of knowledge using GIT like add, commit, merge, branch, checkout, status.

I still have more to learn but im confuse one thing.. how does git handle team?

For example:

  • Developer A computer
  • Developer B computer
  • Developer C computer
  • Central repository (Server)

All Developers working on the same project.

From what I understood (correct me if im wrong).. A ,B and C developers push their branch (master?) to central repository via SSH remote.

But on the central repository, how do I get information or which files (or branch?) that has been pushed from the developers... What would it look like on the central repository?

On the central repository, how would handle merges developers work?

Thanks.

like image 996
user622378 Avatar asked May 17 '11 00:05

user622378


Video Answer


1 Answers

There is no "central repository", per se. You will typically create one because it works out nicely for working in a team and keeping everything/everyone organized.

When setting up this central repository, you will give it a name of some sort. This is your local reference point to this central repository, not everyone on your team has to necessarily call it the same thing. This is a 'remote' in git (and I'm sure many other DVCSs) speak. Most people tend to name it 'origin'. You can find out what branches have been pushed to the origin (and more, such as tags) by doing a git fetch origin. When doing a git pull, you are really doing a git fetch, followed by a git merge.

From what I understood (correct me if im wrong).. A ,B and C developers push their branch (master?) to central repository via SSH remote.

It doesn't necessarily have to be master. Just like origin, master is a naming convention and happens to be the branch that gets created for you when you initialize a directory as being a git repository.

But on the central repository, how do I get information or which files (or branch?) that has been pushed from the developers... What would it look like on the central repository?

See above re: git fetch.

On the central repository, how would handle merges developers work?

You don't have to handle merges on the origin because a developer will have to pull the latest work from everyone else on whatever branch they are working on, before they can push their changes to the origin (and in particular, that branch).

I hope this helps. I am far from understanding all of the ins-and-outs of how it all really works.

like image 88
theIV Avatar answered Oct 05 '22 00:10

theIV