Information Technology Reference
In-Depth Information
and then Peter tries to push:
# command issued in peters-repo
$ git push origin master
This push is rejected, so Peter merges the latest changes in
shared-repo
:
# command issued in peters-repo
$ git pull --edit origin master
Peter types the message for a merge commit as
"Peter merges again..."
and then he pushes his work with:
# command issued in peters-repo
$ git push origin master
The recipe is finished when John and Sara both pull the changes made by Peter:
# command issued in johns-repo
$ git pull origin master
# command issued in sarahs-repo
$ git pull origin master
Now, all four repositories contain the history presented in
Listing 10-3
. The listing
shows the output of the
$ git log --graph --oneline
command executed in
any of the four repositories.
Listing 10-3.
The history created in Recipe 10-3
*
901f9b1 Peter merges again...
|\
| *
70984f8 Sarah merges...
| |\
| * | ebf6fff The first commit by Sarah
* | |
192af3a Peter merges...
|\ \ \
| | |/
| |/|