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

What's in that push?

From the command line, we can use the git show command:

Figure 4.2: Examining the push

There's a lot of information here. First, we see the author and the date. Then we see the message that was attached to this commit (Add properties). Next, Git does a diff (difference) between Book.cs and Book.cs naming the first one a and the second b. The one labeled a is Book.cs before this commit, the one labeled b is the new contents in this commit.

You may have noticed the line that says /dev/null. This indicates that a file is being compared against nothing, and thus everything is new.

The next line shows that /dev/null is being compared against file b (the new Book.cs file):

Figure 4.3: Comparing against dev/null

What follows are the changes. Deletions will be marked in red, modifications in green, and new code in yellow. (This display and these colors may depend on which shell you are using.) We see here that three using statements...