Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development, 3rd Edition
- Length: 545 pages
- Edition: 3
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2022-12-06
- ISBN-10: 1492091197
- ISBN-13: 9781492091196
- Sales Rank: #947728 (See Top 100 Books)
rack, branch, merge, and manage code revisions with Git, the free and open source distributed version control system. Through a series of step-by-step tutorials, this practical guide quickly takes you from Git fundamentals to advanced techniques, and provides friendly yet rigorous advice for navigating Git’s many functions. You’ll learn how to work with everything from small to very large projects with speed and efficiency.
In this third edition, authors Prem Kumar Ponuthorai and Jon Loeliger break down Git concepts using a modular approach. You’ll start with the basics and fundamental philosophy of Git, followed by intermediate commands to help you efficiently supplement your daily development workflow. Finally, you’ll learn advanced Git commands and concepts to understand how Git works under the hood.
- Learn how to use Git for real-world development scenarios
- Gain insight into Git’s common use cases, initial tasks, and basic functions
- Use the system for distributed version control
- Learn how to manage merges, conflicts, patches, and diffs
- Apply advanced techniques such as rebasing, hooks, and ways to handle submodules
Preface Who This Book Is For Essential Know-How New in This Revision Navigating the Book Installing Git A Note on Inclusive Language Omissions Conventions Used in This Book O’Reilly Online Learning How to Contact Us Acknowledgments Attributions I. Thinking in Git 1. Introduction to Git Git Components Git Characteristics The Git Command Line Quick Introduction to Using Git Preparing to Work with Git Working with a Local Repository Creating an initial repository Adding a file to your repository Making another commit Viewing your commits Viewing commit differences Removing and renaming files in your repository Working with a Shared Repository Making a local copy of the repository Configuration Files Hierarchy of configuration files Configuring an alias Summary 2. Foundational Concepts Repositories Git Object Store Index Content-Addressable Database Git Tracks Content Pathname Versus Content Packfiles Visualizing the Git Object Store Git Internals: Concepts at Work Inside the .git Directory Blob Objects and Hashes Tree Object and Files A Note on Git’s Use of SHA1 Tree Hierarchies Commit Objects Tag Objects Summary II. Fundamentals of Git 3. Branches Motivation for Using Branches in Git Branching Guidelines Branch Names Dos and Don’ts in Branch Names Managing Branches Working in Branches Creating Branches Listing Branch Names Viewing Branches and Their Commits Switching (Checking Out) Branches A basic example of checking out a branch Checking out when you have uncommitted changes Git checkout: Working with files versus branches Merging Changes into a Different Branch Creating and Checking Out a New Branch Detached HEAD Deleting Branches Summary 4. Commits Commits: Recorded Units of Change Atomic Changesets Identifying Commits Absolute Commit Names Refs and Symrefs Relative Commit Names Commit History Viewing Old Commits Commit Graphs Using gitk to view the commit graph Commit Ranges Summary 5. File Management and the Index Importance of the Index File Classifications in Git Using git add Notes on Using git commit Using git commit --all Writing Commit Log Messages Using git rm Using git mv A Note on Tracking Renames The .gitignore File Summary 6. Merges Merge: A Technical View Merge Examples Preparing for a Merge Merging Two Branches A Merge with a Conflict Working with Merge Conflicts Locating Conflicted Files Inspecting Conflicts git diff with conflicts git log with conflicts How Git Keeps Track of Conflicts Finishing Up a Conflict Resolution Aborting or Restarting a Merge Merge Strategies Degenerate Merges Normal Merges Recursive merges Octopus merges Specialty Merges Ours and subtree merges Applying Merge Strategies Merge Drivers How Git Thinks About Merges Merges and Git’s Object Model Squash Merges Why Not Just Merge Each Change One by One? Summary 7. Diffs Forms of the git diff Command Simple git diff Example Understanding the git diff Output git diff and Commit Ranges git diff with Path Limiting How Git Derives diffs Summary III. Intermediate Skills 8. Finding Commits Using git bisect Using git blame Using Pickaxe Summary 9. Altering Commits Philosophy of Altering Commit History Caution About Altering History Using git revert Changing the HEAD Commit Using git reset Using git cherry-pick reset, revert, and checkout Rebasing Commits Using git rebase -i rebase Versus merge Summary 10. The Stash and the Reflog The Stash Use Case: Interrupted Workflow Viewing the stashed context Use Case: Updating Local Work in Progress with Upstream Changes Use Case: Converting Stashed Changes Into a Branch The Reflog Summary 11. Remote Repositories Part I: Repository Concepts Bare and Development Repositories Repository Clones Remotes Tracking Branches Referencing Other Repositories Referring to Remote Repositories The refspec Part II: Example Using Remote Repositories Creating an Authoritative Repository Make Your Own Origin Remote Developing in Your Repository Pushing Your Changes Adding a New Developer Getting Repository Updates The fetch step The merge or rebase step Should you merge or rebase? Part III: Remote Repository Development Cycle in Pictures Cloning a Repository Alternate Histories Non-Fast-Forward Pushes Fetching the Alternate History Merging Histories Merge Conflicts Pushing a Merged History Part IV: Remote Configuration Using git remote Using git config Using Manual Editing Part V: Working with Tracking Branches Creating Tracking Branches Ahead and Behind Adding and Deleting Remote Branches Bare Repositories and git push Summary 12. Repository Management Publishing Repositories Repositories with Controlled Access Repositories with Anonymous Read Access Publishing repositories using git-daemon Publishing repositories using an HTTP daemon Publishing repositories using Smart HTTP Publishing repositories via Git and HTTP daemons Repositories with Anonymous Write Access Repository Publishing Advice Repository Structure Shared Repository Structure Distributed Repository Structure Living with Distributed Development Changing Public History Separate Commit and Publish Steps No One True History Knowing Your Place Upstream and Downstream Flows The Maintainer and Developer Roles Maintainer–Developer Interaction Role Duality Working with Multiple Repositories Your Own Workspace Where to Start Your Repository Converting to a Different Upstream Repository Using Multiple Upstream Repositories Forking Projects To fork or not? Reconciling forks Forking projects at GitHub Summary IV. Advanced Skills 13. Patches Why Use Patches? Generating Patches Patches and Topological Sorts Mailing Patches Applying Patches Bad Patches Patching Versus Merging Summary 14. Hooks Types of Hooks A Note on Using Hooks Installing Hooks Example Hooks Creating Your First Hook Available Hooks Commit-Related Hooks Patch-Related Hooks Push-Related Hooks Other Local Repository Hooks To Hook or Not Summary 15. Submodules Gitlinks Submodules Why Submodules? Working with Submodules Adding a submodule Cloning a repository submodule add versus submodule init Changing submodules from within a superproject Pulling submodule updates Pulling updates of a superproject that uses a submodule Switching branches when working with superprojects that have submodules Submodules and Credential Reuse Git Subtrees Adding a Subproject Pulling Subproject Updates Changing the Subproject from Within the Superproject Git Submodule and Subtree Visual Comparison Summary 16. Advanced Manipulations Interactive Hunk Staging Loving git rev-list Date-Based Checkout Date-based checkout cautions Retrieve an Old Version of a File Recovering a Lost Commit The git fsck Command Reconnecting a Lost Commit Using git filter-repo Examples Using git filter-repo Installing git-filter-repo Analyzing a repository Path-based filtering Content-based filtering Commit message filtering Summary V. Tips and Tricks 17. Tips, Tricks, and Techniques Interactive Rebase with a Dirty Working Directory Garbage Collection Tips for Recovering Commits Recovering from an Upstream Rebase Quick Overview of Changes Cleaning Up Using git-grep to Search a Repository Updating and Deleting refs Following Files That Moved Have You Been Here Before? Migrating to Git Migrating from a Git Version Control System Migrating from a Non-Git Version Control System A Note on Working with Large Repositories Git LFS Repository Before Git LFS and After Git LFS Installing Git LFS Tracking Large Objects with Git LFS Useful Git LFS Techniques Converting Existing Repositories to Use Git LFS Summary 18. Git and GitHub About GitHub Types of GitHub Accounts GitHub in the Git Ecosystem Hosting a Repository in GitHub Repository View Code Issues Pull Requests The GitHub Flow Resolving Merge Conflicts in GitHub Development Workflows Integrating with GitHub Summary A. History of Git The Birth of Git Precedents Timeline What’s in a Name? B. Installing Git Using Linux Binary Distributions Debian/Ubuntu Other Binary Distributions Installing Git on macOS Installing Git on Windows Obtaining a Source Release Building and Installing from Source Release Index
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Version Control with Git: Powerful Tools and Techniques for Collaborative Software Development, 3rd Edition
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.