Book Image

Git: Mastering Version Control

By : Aske Olsson, Jakub Narębski, Ferdinando Santacroce, Rasmus Voss
Book Image

Git: Mastering Version Control

By: Aske Olsson, Jakub Narębski, Ferdinando Santacroce, Rasmus Voss

Overview of this book

Git is one of the most popular types of Distributed Version Control System. Since its inception, it has attracted skilled developers due to its robust, powerful, and reliable features. Like most powerful tools, Git can be hard to approach for the newcomers. However, this learning path will help you overcome this fear and become adept at all the basic and advanced tasks in Git. This course starts with an introduction to version control systems before you delve deeply into the essentials of Git. This serves as a primer for the topics to follow such as branching and merging, creating and managing a GitHub personal repository, and fork and pull requests. You'll also learn how to migrate from SVN using Git tools or TortoiseGit and migrate from other VCSs, concluding with a collection of resources, links, and appendices. As you progress on to the next module, you will learn how you can automate the usual Git processes by utilizing the hook system built into Git. It also covers advanced repository management, including different options to rewrite the history of a Git repository before you discover how you can work offline with Git, how to track what is going on behind the scenes, and how to use the stash for different purposes. Moving forward, you will gain deeper insights into Git's architecture, its underlying concepts, behavior, and best practices. It gives a quick implementation example of using Git for a collaborative development of a sample project to establish the foundation knowledge of Git operational tasks and concepts. By exploring advanced Git practices, you will attain a deeper understanding of Git’s behavior, allowing you to customize and extend existing recipes and write your own. This Learning Path is a blend of content, all packaged up keeping your journey in mind. It includes content from the following Packt products: • Git Essentials, Ferdinando Santacroce • Git Version Control Cookbook, Aske Olsson and Rasmus Voss • Mastering Git, Jakub Nar?bski
Table of Contents (36 chapters)
Git: Mastering Version Control
Credits
Preface
3
Git Fundamentals – Working Remotely
Bibliography
Index

Preface

Git is the clear leader in the new paradigm of distributed version control systems. Originally developed by Linus Torvalds as a source control management (SCM) system for the Linux kernel to replace the proprietary SCM BitKeeper, Git has since conquered most of the open source world and is also used by lots of organizations for their private/proprietary projects.

If you are reading this course, 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 aim of this course 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 course is meticulously designed to help you gain deeper insights into Git's architecture and its underlying concepts, behavior, and best practices.

What this learning path covers

Module 1, Git Essentials, cover all the basic topics of Git, thereby letting you start using it even if you have little or no experience with versioning systems. It starts off with the installation and do your first commit. You will learn how to manage and organize code, remotely work with repositories, and few basic Git commands that will come in handy in difficult situations. If you are familiar with other versioning tools this module will help you migrate to Git without much effort. Finally it ends with few best practices and hints that would develop good habits that every developer should posses.

Module 2, Git Version Control Cookbook, is designed to give you practical recipes for everyday Git usage. The recipes can be used directly or as an inspiration for you. This module will cover the Git data model through practical recipes and in-depth explanations so you get a deeper understanding of the internal workings of Git. The recipes also give you precise step-by-step instructions to various common and uncommon Git operations. The book can help ease your daily work with Git by providing recipes for common issues, useful tips and tricks, and in-depth clarifications of why and how they work.

Module 3, Mastering Git, starts with a quick implementation example of using Git for the collaborative development of a sample project to establish the foundation knowledge of Git's operational tasks and concepts. Furthermore, as you progress through this module, subsequent chapters provide detailed descriptions of the various areas of usage: from the source code archaeology, through managing your own work, to working with other developers. It also covers the advanced branching, merging and collaboration techniques. You will also learn to customize and extend Git, manage subprojects, and take up the administrative side of Git. Version control topics are accompanied by in-detail description of relevant parts of Git architecture and behavior. Finally the module ends with the Git best practicesm which will make you proficient in using Git.

What you need for this learning path

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).

Who this learning path is for

This learning path is for software developers who want to become proficient at using the Git version control system. A basic understanding of any version control system would be beneficial. If you have some experience working with command lines, using Linux admin, or just using Unix and want to know more about Git, then this book is ideal for you.

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 www.packtpub.com/authors.

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.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Mastering-Git-Skills. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Errata

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 http://www.packtpub.com/submit-errata, 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 https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

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.

Questions

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.