Book Image

Git Essentials

By : Ferdinando Santacroce
Book Image

Git Essentials

By: Ferdinando Santacroce

Overview of this book

Table of Contents (17 chapters)


If you are reading this book, you are probably a software developer and a professional. What makes a good professional? Sure, culture and experience are a part of the answer, but there's more: a good professional is one who can master different tools, choose the best tool for the job at hand, and has the necessary discipline to develop good working habits.

Version control is one of the base skills for developers and Git is one of the right tools for the job. However, Git can't be compared to a screwdriver, a simple tool with only a basic function; Git provides a complete toolbox that can help you manage your own code, within which there are also other sharp tools that should be handled with caution.

The final aim of this book is to help you to start using Git and its commands in the safest way possible, to get things done without causing any injuries. Having said this, you will not get the most from Git commands if you do not acquire the right habits; just as is the case with other tools, in the end, it is the craftsman who makes all the difference.

This book will cover all the basic topics of Git, thereby letting you start using it even if you have little or no experience with versioning systems; you only need to know about versioning in general and the Wikipedia-related page is enough for this purpose.

What this book covers

Chapter 1, Getting Started with Git shows you all the (simple) steps you need in order to install Git and do your first commit.

Chapter 2, Git Fundamentals – Working Locally reveals the essence of Git, how it takes care of your files, and how you can manage and organize your code.

Chapter 3, Git Fundamentals – Working Remotely moves your attention to the collaborating side of the tool, explaining the basic commands individually and the options you use when working with remote repositories.

Chapter 4, Git Fundamentals – Niche Concepts, Configurations, and Commands completes the basic set of Git commands you need to know, giving you some more weapons to use in difficult situations.

Chapter 5, Obtaining the Most – Good Commits and Workflows gives you some hints about common methods you can use to organize the source code within Git, thereby helping you to develop good habits that every developer should possess.

Chapter 6, Migrating to Git is a way to give you a hand if you're used to other versioning systems, such as Subversion, to manage the transitional phase from another piece of software to Git.

Chapter 7, Git Resources offers you some hints, which I've taken from my experience, and could prove interesting for you.

What you need for this book

To follow the examples used in this book, and make use of them on Git, you only need a computer and a valid Git installation. Git is available for free on every platform (such as Linux, Windows, and Mac OS X). While writing this book, the examples I use are based on the latest version of Git for Windows, which is 1.9.5.

Who this book is for

This book is for developers. The book does not require experience in a particular programming language, nor does it require in-depth experience as a software developer. You can read this book easily if you already use another versioning system, but this can be your first approach to a versioning tool, if you at least know the basics of versioning.


In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Go to the local root folder, C:\Repos, for the repositories "

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

$ git log --oneline

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: " Enabling Windows Explorer integration is generally useful."


Warnings or important notes appear in a box like this.


Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.


Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to and enter the name of the book in the search field. The required information will appear under the Errata section.


Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.


If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.