How to Read This Book

This book is organized in parts to guide you from starting out through more complex situations, with each part broken down into tasks. Tasks follow a specific formula: the left page explains the task and the commands related to it, and the right page gives you the raw commands with a little bit of information about them and a cross-reference to related tasks.

You can read this book in paper form as an open book to see the tasks side by side, but it’s also an excellent reference in digital form, especially when searching for a particular Git task.

If you’re reading a digital version of this book on a computer with a large enough display, I recommend setting your reader to display two pages side by side instead of a single page. That gives you the same visual that’s intended in the book.

On your first pass, I suggest that you read the introductions to each part. They give you a broad overview of how to approach each part of the Git workflow, as well as a synopsis of the tasks contained in that part.

Armed with high-level information, you can determine where to dive in. You can read this book from start to finish or cherry-pick the tasks relevant to what you’re trying to accomplish.

The parts of this book are organized to walk you through the various phases of use in Git.

  • Part I, Getting Started, starts with the absolute basics—installing and configuring Git and creating your first repository.

  • Part II, Working with Git, covers the basic commands you need as part of your day-to-day interaction with Git by yourself. These are the building blocks, and they’re a must-read if this is your first time using Git.

  • Part III, Organizing Your Repository with Branches and Tags, introduces branches, a powerful and central part of Git that’s necessary for understanding how everything works together.

  • Part IV, Working with a Team, covers the most powerful aspect of any VCS: collaborating with other developers. This part gets you up to speed on how to share your work with other developers and retrieve changes from them.

  • Part V, Branches and Merging Revisited, builds on the information in Part III and teaches you how to handle it when things go wrong, as well as some of the more complex ways to handle merging and moving branches around.

  • Part VI, Working with the Repository’s History, introduces you to all the history you’ve been generating. Using this information, you can figure out what another developer (or maybe even you) was thinking when you made a particular change.

  • Part VII, Fixing Things, shows you how Git can help you fix things in your repository—be that commits that need to be adjusted or finding bugs in your code.

  • Part VIII, Moving Beyond the Basics, introduces you to a few concepts that don’t fit into the normal everyday workflow but are useful when they’re needed.

There are diagrams throughout this book. Whenever you see a circle, it represents a commit—with the exception of Figure 2, Shared and distributed repository layout with three developers, where the circles represent repositories.

This matches the style used throughout the Git manual when it shows example repository structures to explain commands. In addition to the standard graphical diagrams throughout, in some places I’ve opted for a plain-text diagram to introduce you to the Git manual diagram style.

Throughout the book you’ll see examples of the output you can expect Git to generate for a given command. Keep in mind that your output won’t be exactly the same because of the way Git keeps track of commit IDs—more on that in a minute.

Several commands don’t generate any output after they run successfully, though. For these commands, I include an empty prompt> after the successful command to show that there is no output.

The first reference to each new term includes an explanation of what the term means. If you read the book from start to finish, you’ll know all of the terms from previous introductions to them.

Did you forget a term or are you using the book as a reference and not reading it straight through? You’re covered there, too. You can refer to Appendix 1, Glossary; there you’ll get explanations of all the common—and some not so common—jargon you’ll encounter in this book and in your adventures in Git.

What Version of Git to Use

I used the 1.7.x version of Git while writing the majority of this book. All of the commands as of this writing work with 1.7.2.1 and should work with the majority of Git 1.6.x versions.

The installation methods mentioned in Task 1, Installing Git all have recent versions of Git available, so make sure you’re running a recent version, and you won’t have any trouble following along. You can run git --version from the command line to see what version you have.

Before we dive into the tasks, let’s talk a bit about Git and what makes it unique.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.255.168