Mastering Git Attain Expert-Level Proficiency with Git by Mastering Distributed Version Control Features
Developers often feel overwhelmed by complex version control issues, especially when managing large repositories. This updated second edition of our Git guide empowers you to tackle these challenges head-on and emerge as a Git pro. The book gets you up to speed with the latest Git version, its featu...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham :
Packt Publishing
[2024]
|
Edición: | Second edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009843331906719 |
Tabla de Contenidos:
- Cover
- Title Page
- Copyright and Credits
- Contributors
- Table of Contents
- Preface
- Part 1 - Exploring Project History and Managing Your Own Work
- Chapter 1: Git Basics in Practice
- Technical requirements
- A brief introduction to version control and Git
- Git by example
- Setup and initialization
- Collaborative development
- Branching and merging
- Summary
- Questions
- Answers
- Further reading
- Chapter 2: Developing with Git
- Creating a new commit
- How a new commit extends a project's history
- The index - a staging area for commits
- Examining the changes to be committed
- Selective commit
- Amending a commit
- Working with branches and tags
- Creating a new branch
- Creating orphan branches
- Selecting and switching to a branch
- Listing branches and tags
- Rewinding or resetting a branch
- Deleting a branch
- Changing the branch name
- Summary
- Questions
- Answers
- Further reading
- Chapter 3: Managing Your Worktrees
- Ignoring files
- Marking files as intentionally untracked (ignored)
- Which types of files should be ignored?
- Listing ignored files
- Trick - ignoring changes in tracked files
- File attributes
- Identifying binary files and end-of-line conversions
- Diff and merge configuration
- Transforming files (content filtering)
- Keyword expansion and substitution
- Other built-in attributes
- Defining attribute macros
- Fixing mistakes with the reset command
- Rewinding the branch head, softly
- Resetting the branch head and the index
- Discarding changes and rewinding the branch
- Safer reset - keeping your changes
- Stashing away your changes
- Using git stash
- Stash and the staging area
- Stash internals
- Managing worktrees and the staging area
- Examining files and directories
- Searching file contents.
- Un-tracking, un-staging, and un-modifying files
- Resetting a file to the old version
- Cleaning the working area
- Multiple working directories
- Summary
- Questions
- Answers
- Further reading
- Chapter 4: Exploring Project History
- DAGs
- Whole-tree commits
- Branches and tags
- Branch points
- Merge commits
- Single revision selection
- HEAD - the implicit revision
- Branch and tag references
- The
- branches,
- tags, and similar options
- SHA-1 and the shortened SHA-1 identifier
- Ancestry references
- Reverse ancestry references - git-describe output
- Reflogging shortnames
- Upstreaming remote-tracking branches
- Selecting revisions via a commit message
- Selecting the revision range
- Single revision as a revision range
- Double-dot notation
- Creating the range by including and excluding revisions
- The revision range for a single revision
- Triple-dot notation
- Summary
- Questions
- Answers
- Further reading
- Chapter 5: Searching Through the Repository
- Searching the history
- Limiting the number of revisions
- Matching revision metadata
- Searching changes in revisions
- Selecting types of changes
- History of a file
- Path limiting
- History simplification
- Blame - the line-wise history of a file
- Finding bugs with git bisect
- Starting the git bisect process
- Finding the buggy commit
- Automating testing during the git bisect process
- Selecting and formatting the git log output
- Predefined and user-defined output formats
- Including, formatting, and summing up changes
- Summarizing contributions
- Mapping authors
- Viewing a revision and a file at revision
- Summary
- Questions
- Answers
- Further reading
- Part 2 - Working with Other Developers
- Chapter 6: Collaborative Development with Git
- Collaborative workflows
- Bare repositories.
- Interacting with other repositories
- The centralized workflow
- The peer-to-peer or forking workflow
- The maintainer or integration manager workflow
- The hierarchical or dictator-and-lieutenants workflow
- Managing remote repositories
- The "origin" remote
- Listing and examining remotes
- Adding a new remote
- Updating information about remotes
- Support for triangular workflows
- Chain of trust
- Content-addressed storage
- Lightweight, annotated, and signed tags
- Signed commits
- Merging signed tags (merge tags)
- Summary
- Questions
- Answers
- Further reading
- Chapter 7: Publishing Your Changes
- Transport protocols and remote helpers
- Local transport
- Smart transports
- Legacy (dumb) transports
- Offline transport with bundles
- Remote transport helpers
- Credentials/password management
- Publishing your changes upstream
- Pushing to a public repository
- Generating a pull request
- Exchanging patches
- Summary
- Questions
- Answers
- Further reading
- Chapter 8: Advanced Branching Techniques
- The purpose of branching
- Isolation versus integration
- The path to production release
- Long-running and short-lived branches
- Visibility of branches
- Alternatives to branching
- Visibility without integration
- Branching patterns
- Integration patterns
- Release engineering
- Other branching patterns involving long-lived branches
- Other types of short-lived branches
- Branching workflows and release engineering
- The release and trunk branches workflow
- The graduation branches workflow
- The topic branches workflow
- git-flow - a successful Git branching model
- Ship/Show/Ask - a modern branching strategy
- Fixing a security issue
- Interacting with branches in remote repositories
- Upstream and downstream
- Remote-tracking branches and refspec
- Fetching and pulling versus pushing.
- Fetching and pushing branches and tags
- Push modes and their use
- Summary
- Questions
- Answers
- Further reading
- Chapter 9: Merging Changes Together
- Methods of combining changes
- Merging branches
- Copying and applying a changeset
- Rebasing a branch
- Squash merge
- Resolving merge conflicts
- The three-way merge
- Examining failed merges
- Avoiding merge conflicts
- Dealing with merge conflicts
- Summary
- Questions
- Answers
- Further reading
- Chapter 10: Keeping History Clean
- An introduction to Git internals
- Git objects
- Plumbing and porcelain Git commands
- Rewriting history
- Amending the last commit
- The interactive rebase
- External tools - patching management interfaces
- Rewriting project history with Git filter-repo
- External tools for large-scale history rewriting
- The perils of rewriting published history
- Amending history without rewriting
- Reverting a commit
- Storing additional information with notes
- Using git replace
- Summary
- Questions
- Answers
- Further reading
- Part 3 - Managing, Configuring, and Extending Git
- Chapter 11: Managing Subprojects
- Building a living framework
- Managing dependencies outside of Git
- Manually importing the code into your project
- A Git subtree solution for embedding the subproject code
- Creating a remote for a subproject
- Adding a subproject as a subtree
- Cloning and updating superprojects with subtrees
- Getting updates from subprojects with a subtree merge
- Showing changes between a subtree and its upstream
- Sending changes to the upstream of a subtree
- The Git submodules solution - a repository inside a repository
- Gitlinks, .git files, and the git submodule command
- Adding a subproject as a submodule
- Cloning superprojects with submodules
- Updating submodules after superproject changes.
- Examining changes in a submodule
- Getting updates from the upstream of the submodule
- Sending submodule changes upstream
- Transforming a subfolder into a subtree or submodule
- Subtrees versus submodules
- Use cases for subtrees
- Use cases for monorepo
- Use cases for submodules
- Third-party subproject management solutions
- Summary
- Questions
- Answers
- Further reading
- Chapter 12: Managing Large Repositories
- Scalar - Git at scale for everyone
- Handling repositories with a very long history
- Using shallow clones to get truncated history
- Cloning only a single branch
- Making operations faster in repositories with a long history
- Handling repositories with large binary files
- Splitting the binary asset folder into a separate submodule
- Storing large binary files outside the repository
- Handling repositories with a large number of files
- Limiting the number of working directory files with sparse checkout
- Reducing the local repository size with sparse clone
- Faster checking for file changes with filesystem monitor
- Summary
- Questions
- Answers
- Further reading
- Chapter 13: Customizing and Extending Git
- Git on the command line
- Git-aware command prompt
- Command-line completion for Git
- Autocorrection for Git commands
- Making the command line prettier
- Alternative command line
- Graphical interfaces
- Types of graphical tools
- Graphical diff and merge tools
- Graphical interface examples
- Configuring Git
- Command-line options and environment variables
- Git configuration files
- Per-file configuration with gitattributes
- Automating Git with hooks
- Installing a Git hook
- A template for repositories
- Client-side hooks
- Server-side hooks
- Extending Git
- Command aliases for Git
- Adding new Git commands
- Credential helpers and remote helpers
- Summary.
- Questions.