▶Book Description
Git is one of the most popular tools for versioning. Git Version Control Cookbook builds on the success of the previous edition and provides you with an up-to-date guide to solving problems related to versioning.
You’ll start by learning about the Git data model and how it stores files and looks at commits. By using simple commands, you’ll learn how to navigate through the database. Once you have accustomed yourself to the basics, you’ll explore techniques to configure Git with comprehensive examples and configuration targets. You’ll gain insights into improving your understanding of branches and recovery from mistakes — right from committing to a wrong branch to recovering lost commits or files. You’ll then move on to discovering the features that Git rebase has to offer and use regular Git merge on other branches. You’ll explore Git notes and learn how to utilize the update, list, and search commands. In addition to this, you’ll learn how to extract metadata from repositories and automate your daily tasks using Git hooks. You’ll then study in detail repository maintenance, patching, and offline sharing. By the end of the book, you’ll have grasped various tips and tricks for everyday usage, while increasing your knowledge of Git providers, integrations, and clients.
▶What You Will Learn
⦁ Understand the Git data model and use commands to navigate the database
⦁ Find out how you can recover lost commits or files
⦁ Force a rebase on some branches and use regular Git to merge on the rest
⦁ Master the techniques required to extract metadata from repositories
⦁ Explore Git notes and learn about the various features that it offers
⦁ See how to decode different subcommands
▶Key Features
⦁ Explore practical recipes to use Git’s most advanced features
⦁ Learn how Git references its objects and how history is recorded
⦁ Use reflog and git fsck to recover lost information
▶Who This Book Is For
This book targets developers, professional build/release managers, and DevOps practitioners who want a practical guide for the next level of Git. Starting with the Git data model and advancing through branching to metadata and hooks, all through an easy-toread recipe structure, the transition from simple, everyday use cases to advanced repository handling is smooth. The book can be easily read and understood by readers from the target audience. You need basic knowledge of common GNU/Linux tools and Shell/Bash scripting to get the most from this book.
▶What this book covers
⦁ Chapter 1, Navigating Git, shows how Git stores files and commits. Examples will visually show you the data model and how to navigate the history and database with simple commands.
⦁ Chapter 2, Configuration, shows how a lot can be configured in Git, how configuration targets are set, the different configuration levels, and some useful targets.
⦁ Chapter 3, Branching, Merging, and Options, will give you a deeper understanding of branching and the options for easy push/pull targets. It also shows you the different merge strategies and some tips on how to record merge resolutions.
⦁ Chapter 4, Rebasing Regularly and Interactively, and Other Use Cases, shows you how rebasing can be used instead of merging, along with a lot of other use cases of rebasing, such as cleaning up the history before publishing, and testing single commits.
⦁ Chapter 5, Storing Additional Information in Your Repository, takes you on a tour of Git notes. It will show you how to tie additional information to a commit, and how to use and see this information again.
⦁ Chapter 6, Extracting Data from the Repository, shows you how to extract statistics and other metadata from the repository.
⦁ Chapter 7, Enhancing Your Daily Work with Git Hooks, Aliases, and Scripts, contains a collection of recipes that will help you automate much of the tedious daily work.
⦁ Chapter 8, Recovering from Mistakes, walks you through several recovery scenarios, from local undo, to where-is-my-old-commit, to global recovery scenarios.
⦁ Chapter 9, Repository Maintenance, is a collection of recipes that relate to the maintenance and management of repositories, from forcing garbage collection, over-splitting, and joining repositories, to completely rewriting history.
⦁ Chapter 10, Patching and Offline Sharing, shows you how to work offline with Git and share the work by means other than pushing and pulling.
⦁ Chapter 11, Tips and Tricks, is a collection of recipes that cover various topics, from simple tips to displaying the current branch in your prompt to advanced Git tools, such as bisect and stash.
⦁ Chapter 12, Git Providers, Integrations, and Clients, introduces the largest Git-hosting site, GitHub. Moreover, the chapter will discuss how to integrate Jenkins for automated builds and tests.