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

Chapter 1. Getting Started with Git

Whether you are a professional or an amateur developer, you've likely heard about the concept of version control. You may know that adding a new feature, fixing broken ones, or stepping back to a previous condition is a daily routine.

This implies the use of a powerful tool that can help you take care of your work, allowing you to move around your project quickly and without friction.

There are many tools for this job on the market, both proprietary and open source. Usually, you will find Version Control Systems (VCS) and Distributed Version Control Systems (DVCS). Some examples of centralized tools are Concurrent Version System (CVS), Subversion (SVN), Team Foundation Server (TFS) and Perforce, while in DVCS, you can find Bazaar, Mercurial, and Git. The main difference between the two families is the constraint—in the centralized system—to have a remote server where get and put your files; if the network is down, you are in trouble. In DVCS instead, you can have or not a remote server (even more than one), but you can work offline, too. All your modifications are locally recorded so that you can sync them some other time. Today, Git is the DVCS that has gained public favor more than others, growing quickly from a niche tool to mainstream.

Git has rapidly grown as the de facto to version source code. It is the second famous child of Linus Torvalds, who, after creating the Linux kernel, forged this versioning software to keep trace of his millions lines of code.

In this first chapter, we will start at the very beginning, assuming that you do not have Git on your machine. This book is intended for developers who never used Git or used it a little bit, but who are scared to throw themselves headlong into it.

If you have never installed Git, this is your chapter. If you already have a working Git box, you can quickly read through it to check whether everything is right.