Information Technology Reference
In-Depth Information
You want to organize the work of your team consisting of an arbitrary number of deve-
lopers. Every developer will use his or her own repository. They will share their work
using a central repository. The setting is identical to Recipe 10-2.
This time you want to define a workflow that will guarantee a linear structure of the
master branch in all repositories. Merge commits are not allowed and should not appear
in any repository.
To keep the history linear all team members need to rebase their work on top of the
updated remote tracking branch.
Solution
Create a new directory with:
$ cd git-recipes
$ mkdir 10-04
$ cd 10-04
and then initialize a project with:
# the command issued in git-recipes/10-04 directory
$ git init --bare shared-repo
Now John initializes his repository, creates an initial commit, and pushes it to
shared-repo:
# commands issued in git-recipes/10-04 directory
$ git clone shared-repo johns-repo
$ cd johns-repo
$ git simple-commit i1 i2
$ git push -u origin master
Then the next developer, Mark, joins the team:
# commands issued in git-recipes/10-04 directory
$ git clone shared-repo marks-repo
Right now johns-repo , shared-repo , and marks-repo contain the same
commits i1 and i2 . The $ git status -sb command prints only the name of
Search WWH ::




Custom Search