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

To get the most out of this book

  • You will want to be somewhat comfortable with a programming language. Familiarity with C# is a big plus, but not required.
  • You will need Git (free) installed on your computer, and it would be best also to have the latest free version (or better) of Visual Studio 2019. Finally, you'll want to download and install (free) GitHub Desktop. Thus, you do not have to spend any money to follow the examples in this book.
  • A note to macOS users: All of the above applies to you as well, and I don't anticipate you having any additional issues.
  • A note to Linux users: I don't work with Unix, but I strongly suspect that all of the above (except Visual Studio) will apply to you as well.

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801075732_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: "If you look at the log, git log --oneline, you should see all three commits: the one created when you cloned the repository and the two you created by hand."

A block of code is set as follows:

public int Add (int left, int right)
{
    return left + right;
}
public int Subtract (int left, int right)
{
    return left - right;
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

public int Add (int left, int right)
{
    return left + right;
}
public int Subtract (int left, int right)
{
    return left - right;
}

Any command-line input or output is written as follows:

git add .
git commit -m "Add calculator class"

Bold: Indicates a new term, an important word, or words that you see on the screen. Words in menus or dialog boxes appear in the text like this. For example: "Select System info from the Administration panel."

Warnings or important notes appear like this.