Book Image

Git for Programmers

By : Jesse Liberty
Book Image

Git for Programmers

By: Jesse Liberty

Overview of this book

Whether you’re looking for a book to deepen your understanding of Git or a refresher, this book is the ultimate guide to Git. Git for Programmers comprehensively equips you with actionable insights on advanced Git concepts in an engaging and straightforward way. As you progress through the chapters, you’ll gain expertise (and confidence) on Git with lots of practical use cases. After a quick refresher on git history and installation, you’ll dive straight into the creation and cloning of your repository. You’ll explore Git places, branching, and GUIs to get familiar with the fundamentals. Then you’ll learn how to handle merge conflicts, rebase, amend, interactive rebase, and use the log, as well as explore important Git commands for managing your repository. The troubleshooting part of this Git book will include detailed instructions on how to bisect, blame, and several other problem handling techniques that will complete your newly acquired Git arsenal. By the end of this book, you’ll be using Git with confidence. Saving, sharing, managing files as well as undoing mistakes and basically rewriting history will be a breeze.
Table of Contents (16 chapters)
11
Finding a Broken Commit: Bisect and Blame
13
Next Steps
14
Other Books You May Enjoy
15
Index

Answer

As always, there is no one single correct way to do this. Here is how I worked through it.

Task #1: Set up a new repository and clone it to two different folders

Notice that we are going to use just one repository. We are building a single program, but at least at first John is going to create the calculator while Sara is going to create the temperature converter. We'll call the entire program UtilityKnife. To begin we go to GitHub.com and create our new repository:

Figure 4.29: Creating the new repository

The readme file is written using Markdown. You can learn more about Markdown at https://www.markdownguide.org/cheat-sheet/ among other places on the net.

We then clone the repo into folders (or separate computers if there are two or more of you). I'll create a directory, John, and clone this repo into that directory.

Figure 4.30: Cloning from the command line

John has chosen to use the command line. Sara, on the...