Information Technology Reference
In-Depth Information
CHAPTER 10
Remote Repositories and Syn-
chronization
The inherent reason behind all VCS systems is to make the collaboration within a group
of developers as seamless as possible. Finally, we have reached the point where we can
discuss how to use git for a group work. We will start with the simplest settings where
all the repositories are available through local storage.
First you have to learn how to use remotes. We will discuss this in a recipe that shows
you exactly what happens when you clone a repository. Then we will dive into recipes
that present step-by-step methods on how two or more developers can cooperate. We
will consider two important cases:
• First: where a bare repository is shared and accessed by all members
• Second: where two developers cooperate directly, without any additional
repository
You can think about the first one as a centralized client/server solution and the other
as a peer-to-peer solution. Git is a distributed system that allows you to mingle both ap-
proaches.
The easiest way to download new contributions from a central repository is to use the
$ git pull command. When used with default settings, this can lead to a very com-
plicated history of your project. I will show you exactly when and why you can expect
troubles. This will lead us to improved recipes that will always provide you with a clean
history.
The subject of different types of branches that I mentioned in Recipe 5-2 will arise
again. This time, we will pursue it to the very end. You will learn all you need to know
Search WWH ::




Custom Search