Book Image

Git Essentials - Second Edition

By : Ferdinando Santacroce
Book Image

Git Essentials - Second Edition

By: Ferdinando Santacroce

Overview of this book

Since its inception, Git has attracted skilled developers due to its robust, powerful, and reliable features. Its incredibly fast branching ability transformed a piece of code from a niche tool for Linux Kernel developers into a mainstream distributed versioning system. Like most powerful tools, Git can be hard to approach since it has a lot of commands, subcommands, and options that easily confuse newcomers. The 2nd edition of this very successful book will help you overcome this fear and become adept in all the basic tasks in Git. Building upon the success of the first book, we start with a brief step-by-step installation guide; after this, you'll delve into the essentials of Git. For those of you who have bought the first edition, this time we go into internals in far greater depth, talking less about theory and using much more practical examples. The book serves as a primer for topics to follow, such as branching and merging, creating and managing a GitHub personal repository, and fork and pull requests. You’ll then learn the art of cherry-picking, taking only the commits you want, followed by Git blame. Finally, we'll see how to interoperate with a Subversion server, covering the concepts and commands needed to convert an SVN repository into a Git repository. To conclude, this is a collection of resources, links, and appendices to satisfy even the most curious.
Table of Contents (8 chapters)

Summary

In this chapter, you learned that Git is not so difficult to install, even on a non-Unix platform, such as Windows.

Once you have chosen a directory to include in a Git repository, you can see that initializing a new Git repository is as easy as executing a git init command. For now, don't worry about saving it on a remote server and so on. It's not mandatory to save it; you can do this when you need, preserving the entire history of your repository. This is a killer feature of Git and DVCS in general. You can comfortably work offline and push your work to a remote location when the network is available, without any hassle.

Lastly, we discovered one of the most important character traits of Git: it will do nothing if you don't mention it explicitly. You also learned a little bit about the add command. We were obliged to perform a git add command for a file when we committed it to Git for the very first time. Then, we used another command when we modified it. This is because if you modify a file, Git does not expect that you want it to be automatically added to the next commit (and it's right to assume this, I'd say).

In the next chapter, we will look at some fundamentals of Git.