Git by example
Let’s follow a step-by-step, section-by-section, simple example of two developers using Git to work together on a simple project. You can find all three repositories (for two developers, and the bare server repository) with the example code files for this chapter, where you can examine the code, history, and reflog, at https://github.com/PacktPublishing/Mastering-Git---Second-Edition, in a sample_project.zip
archive.
Following the example
To follow this example of the team development process on a single computer, you can simply create three folders called, for example, alice/
, bob/
, and server/
, and switch to the appropriate folder when following work done by Alice, Bob, and Carol, respectively.
There are a few simple changes you need to make for this simulation to work. When creating a repository as Carol, you don’t need to create and switch to the /srv/git
directory, so you can simply skip these commands. In Alice or Bob’s role, you need...