Information Technology Reference
In-Depth Information
# command issued by leader in 10-07/leaders-repo directory
$ git remote add origin ../shared-repo
At this point you join the team:
# command issued in git-recipes/10-07 directory
$ git clone shared-repo johns-repo
Because we will copy the three repositories created in this recipe, John needs to re-
define his origin to use relative path:
# command issued in 10-07/johns-repo directory
$ git remote rm origin
$ git remote add origin ../shared-repo
To contribute to the project follow the procedure (all the commands should be is-
sued in
10-07/johns-repo
):
1. Create the branch for your contributions:
$ git checkout -b
new-web-interface
2. Commit in your
new-web-interface
branch:
$ git simple-
commit a b c
3. Send the branch to the shared repository:
$ git push -u origin
new-web-interface
Now your contributions are stored in the remote branch
new-web-interface
in
the remote repository
shared-repo
.
How It Works
This recipe presents a much more convenient solution for organizing the cooperation of
project members then working in a master branch. By using a dedicated remote branch
for a task, you gain more flexibility in setting groups within your team. You also can
inspect the code before merging it into the master branch.