- Git Large File Storage (LFS): Replaces large files (e.g., videos, images, datasets) with pointers and stores them separately to avoid bloating the repository.
- Git Annex: Alternative to LFS, allowing managing large/binary files outside Git while keeping track of them.
- Delta Compression &
core.bigFileThreshold: Git handles binary files poorly due to diff-based storage; this setting optimizes performance for large binaries.
- Git Submodules: Enables linking another repository within a repository (useful for dependencies, libraries).
- Requires manual updates (
git submodule update --init --recursive). - Challenges: Version tracking, nested submodules, and additional complexity.
- Requires manual updates (
- Git Subtree: An alternative that allows merging and splitting subprojects into a main repository with easier management (
git subtree add/push/pull).
- Git Worktrees: Allows working on multiple branches simultaneously in different directories without cloning the repo multiple times (
git worktree add). - Use cases: Parallel feature development, handling hotfixes while working on a big feature branch.
- Reflogs (
git reflog): Tracks branch movements and allows recovery of lost commits. - Loose & Packed Objects: Understanding blobs, trees, commits, and tags.
- Alternate Object Storage (
.git/objects/info/alternates): Allows sharing objects between repositories.
- Interactive Rebase (
git rebase -i): Rewriting commit history (squash, fixup, reordering). - Filter-Branch &
git filter-repo: Cleaning repository history (e.g., removing sensitive data). - Commit Graph (
git commit-graphandgit gc): Improves performance for large repositories.
- Sparse Checkout (
git sparse-checkout): Allows working with only a subset of a repository’s files (useful for monorepos). - Partial Clone (
git clone --filter=blob:none): Clones a repo without downloading all blobs initially, fetching them on-demand.
- Client-side Hooks (
.git/hooks/): Automation before/after commits, pushes, merges (e.g., linting, security checks). - Server-side Hooks: Enforcing policies on a shared repository (e.g., preventing force pushes).
- Custom Merge Drivers: Handling specific merge scenarios for non-text files.
- Signed Commits (
git commit -S): Verifying commit authorship (GPG/SSH signatures). - Signed Tags (
git tag -s): Ensuring tag authenticity. - Git Verify &
git fsck: Checking repository integrity.
- Git Bisect (
git bisect start): Finding the commit that introduced a bug by binary search. - Git Blame (
git blame): Tracking changes in a file to specific commits/authors. - Git Grep (
git grep): Searching efficiently within a repository.
- Reftables (Experimental): Aims to improve reference storage performance.
- Git with Different Backends: Git can store objects in alternative formats (e.g., SQLite, SHA-256 support).
- Using
git update-index --skip-worktreevs.assume-unchanged: Ignoring local file changes.