Boost Your Git DX second update out now

Today I have released the second update to Boost Your Git DX, my book of developer experience (DX) recommendations for using Git. Since the last update (2024-04-04), it has grown again by 28 pages, for a new total of 391 pages!
Changes include:
- Updating to Git 2.48 (2025-01-10, just three weeks ago), including some small changes and one larger one to use new features.
- A new chapter on
git initandgit clonewhich collects old sections and adds new ones to help you use these commands more efficiently. - Several new sections related to these Git commands:
git switch,git merge,git rebase, andgit stash. - Several new sections related to extra tools: Less, delta, ExifTool, pandoc.
- Brand new screenshots done in light mode, to make them match the PDF and be readable on e-ink devices.
Thanks to everyone who has supported this book so far: nearly 1,000 readers, with 35 ratings averaging 4.97 stars. Here are a few reviews picked from the Gumroad page:
This book is simply amazing, from page 1 the content in invaluable with tips and tricks that will make any dev more productive. Thank you Adam for the great book.
—Gary Jarrel
In a similar spirit to Adam's other excellent Django DX book, this book provides a fluff free tour through lots of little quality of life improvements for developers, not just for using git, but other things around developer shell workflow.
—R Mawlabaux
This book transformed my day-to-day operations. As a self-taught engineer, I have found myself starved for mentorship, and Boost Your Git DX was my most influential mentor in 2023. If you're looking to maximize the usefulness of Git past basic version control, you will love this book.
—Anonymous
Many improvements in this edition came from reader feedback, so please keep that coming. There are feedback form links at the end of each chapter to make it easy, but an email is good too!
This update is free for all existing readers. Indeed, all my books come with free updates for life.
If you’re already a reader, download the new version using the Gumroad link in your email receipt. To help you catch up, the introduction chapter has a changelog with links to the updated sections (reproduced below).
Otherwise, buy it today and dive in. The book is available individually or bundled with Boost Your Django DX for a discount. There’s also an automatic discount to match local purchasing power in your country.
Or download a free sample first.
May you Git good in 2025,
—Adam
Changelog
Upgraded to Git 2.48. As part of this, the diff prefix section has changed to recommend the
diff.srcPrefixanddiff.dstPrefixoptions instead ofdiff.noPrefix. Check it out if you setdiff.noPrefixin your configuration.Redid all the screenshots in the book with a light terminal theme. This makes them more readable with the PDF’s white background and on e-ink screens.
Added a new chapter “
initandclone” coveringgit initandgit clone. Some existing content was moved into this chapter:- Changing the default branch name to
main - Aliasing
masterasmainin legacy repositories - Experimenting with SHA-256
New content covers:
- The basics of
initandclone - Git Credential Manager
- Partial cloning with
--depthor--shallow-since - Fast duplicate clones with a local path or
--referenceand--dissociate
- Changing the default branch name to
Renamed chapter 5 from “Shell tools” to “Command line tools”, to reflect that the covered tools don’t integrate with your shell.
Moved
git worktreeinto its own chapter, number 19, and tidied up chapter 10, now called “branchandswitch”.Added a section on delta’s side-by-side diff view—useful for reviewing large changes.
Added a section on creating branches with a given start point using
git switch -c.Added a section on faster branch switching with parallel checkout by setting
core.workers.Added two sections on checking in-progress commits during merging and rebasing—use these to understand tricky merge conflicts.
Added a section on stashing untracked files with
git stash.Updated the Less configuration section by breaking the
export LESS=...command across multiple lines.Updated the ripgrep + delta section to reflect updates to both tools.
Updated the help section to cover selecting a browser for web-based help.
Updated the branch order-by-recency section to improve the
git switch-recentalias with--bindandgit log’s--stat.Updated “List changed files with
git diff --name-only” with an example of running changed test files.Updated the ExifTool and Pandoc sections to cover the cases when they encounter invalid files. ExifTool produces empty output, whilst Pandoc crashes (which crashes Git itself).
Fixed the ePub cover image.
Table of contents
- Introduction
- About this book
- Read in any order
- Example commands and resources
- End-of-chapter feedback links
- Acknowledgements
- Changelog
- About this book
- Global configuration
- Git’s configuration files
- Store global configuration in
~/.config/git - Migrate from legacy
~/.gitconfigto~/.config/git/config - Read and change options with
git config - Trace options with
git config --show-scopeand--show-origin
- Store global configuration in
- Basic configuration
- Set your name and email address
- Use a different email address based on the working directory
- Use your favourite editor
- Set up a global ignore file
- Improve the default colourization with
color.*options - Enable
help.autoCorrectto fix mistyped commands
- Back up your configuration
- Set up your dotfiles repository
- Save ongoing configuration changes
- Track other configuration files
- Restore your backup
- Git’s configuration files
- Aliases
- Shell aliases
- Create shell aliases with
alias <name>=<command> - List aliases with
alias - Bypass aliases with
\
- Create shell aliases with
- Git aliases
- Create an alias that runs a single Git command
- Create an alias that runs shell commands
- Add a
git gitalias to help when you lose attention
- Shell aliases
- Shell configuration
- oh-my-zsh: instant enhancements and aliases
- Install oh-my-zsh
- Some handy Git aliases
- Learn your aliases on the go with zsh-you-should-use
- Starship: a powerful, performant prompt
- Install Starship
- Personalize your prompt
- Read Git state at a glance with Starship’s prompt
- oh-my-zsh: instant enhancements and aliases
- Command line tools
- Less: the power pager
- Activate lesser-known features with the
LESSenvironment variable - Scroll and search with keyboard shortcuts
- Search forwards with
/and backwards with? - Use Less with more Git commands
- Activate lesser-known features with the
- delta: dapper diff display
- Install and configure delta
- How delta enhances Git’s output
- Temporarily disable delta
- Run delta directly as a diff tool
- Show a side-by-side diffs with
delta -sordelta.side-by-side
- ripgrep: rip-roaringly rapid grep
- Install ripgrep
- Search basics
- Change case sensitivity with
-ior-S - Hyperlink file paths with
--hyperlink-format - Unrestrict searches with specific options or
-u - Filter by file extensions with
-gor-t - Configure ripgrep in
~/.config/ripgreprc - Combine with delta for paging and enhanced formatting
- Less: the power pager
- Repository configuration
- Ignore files
- The basics of ignore files
- Ignore file tips
- Commands for debugging ignore files
- Ignore files
- Hooks and the pre-commit framework
- Git hooks
- pre-commit: Universal Hook Manager
- Install pre-commit
- Configure pre-commit
- Update hooks with
pre-commit autoupdate - Extra protection from pre-commit-hooks
- ripsecrets: Protect your secrets
- Find more hooks
- Skip hooks temporarily with
--no-verifyorSKIP - oh-my-zsh plugin
- pre-commit ci: continuous integration for your hooks
- Command commonalities
- Common options
- Get short or long help with
-hor--help - Condense output with
column.ui=auto - Override configuration with
-c - Use repositories in other directories with
-C
- Get short or long help with
- Commit SHAs
- SHA abbreviation
- Show and copy the current commit SHA
- Commit references
- Single commit references
- Commit range references
- Date specifications
- Top formats
- Pathspecs
- Top pathspec syntaxes
- Using pathspecs
- Common options
initandcloneinitinitbasics- Make the default branch name
mainwithinit.defaultBranch - Alias
masterasmainin legacy repositories - Create a futuristic SHA-256 repository with
--object-format=sha256
cloneclonebasics- Manage credentials with Git Credential Manager (GCM)
- Clone partial history with
--depthor--shallow-since - Optimize duplicate clones with a local path or
--referenceand--dissociate
branchandswitchbranch- List branches with the bare command or
-l - Sort branches by recency with
branch.sortand select withfzf(fuzzy finder) - List branches missing a given commit with
--no-contains - Delete old branches on your Git host automatically
- Prune fetched remote branches with
fetch.prune - Delete local merged branches with a
rm-mergedalias
- List branches with the bare command or
switchswitchbasics- Check out tags or old commits by detaching with
-d - Create a new branch from a different start point
- Speed up switching with parallel checkout by setting
checkout.workers=0
statusanddiffstatus- Enable denser output with
--shortorstatus.short - Shorten long format by disabling advice with
advice.statusHints - Hide untracked files with
-uno
- Enable denser output with
diff- Improve diff generation with
diff.algorithm=histogram - See more context with
diff.interHunkContext - Enable language-specific hunk headings
- Diff media files with ExifTool
- Diff document files with Pandoc
- Make file paths complete with
diff.srcPrefixanddiff.dstPrefix - List changed files with
git diff --name-only
- Improve diff generation with
addandrestoreadd(andmvandrm)- The three commands:
add,mv, andrm - Add interactively with
git add -p - Add all changes with
git add -uor-A
- The three commands:
restore- Use
git restoreinstead ofcheckoutandreset - Top
git restorecommands - Restore interactively with
-p
- Use
commitandresetcommit- Improve commit message editing with verbose mode and “scissors” cleanup
- Use
-mto set the message without your editor - Use
-aor an alias to add all files and commit - Declare coauthors in
co-authored-bytrailers - Update the previous commit with
--amend - Create empty commits with
--allow-empty
reset- Undo commits and keep their changes with
--mixedor--soft - Undo commits and discard their changes with
--keep(not--hard) - Useful commit references for resetting
- Undo commits and keep their changes with
stashandapplystashstashbasics- Push stash entries with a description with
-m - Stash selected files by pathspec
- Stash only unstaged changes with
-kor staged changes with-S - Stash selected hunks interactively with
-p - Automatically stash during merge and rebase with the autostash options
- Stash untracked files with
-u(and see them withstash.showIncludeUntracked)
applyapplybasics- Send and receive patches by copy and paste
applyoutside of a Git repository
pushandpullpush- Automatically create upstream branches with
push.autoSetupRemote - Force push safely with
--force-with-leaseand--force-if-includes - Push a commit and its annotated tags with
--follow-tags
- Automatically create upstream branches with
pull- Rebase divergent branches when you pull with
pull.rebase - Make a branch pull from and push to different remotes
- Rebase divergent branches when you pull with
mergeandrebasemerge- Improve conflict display with the
zdiff3style - Open all conflicted files with the
edit-unmergedalias - Enable rerere to reuse recorded (conflict) resolutions
- Pick one side of conflicts with
git restoreorgit merge -X - Check the in-progress commits with
@andMERGE_HEAD
- Improve conflict display with the
rebase- Control rebasing with interactive mode (
-i) - Top interactive mode actions
- Squash and rebase a branch with
--keep-base - Rebase stacked branches with
--update-refs - Run a command at each step with
-x - Check the in-progress commits with
@,REBASE_HEAD, andORIG_HEAD - Automatically fix up commits with
rebase.autoSquash - Drop already-merged commits with
--empty drop
- Control rebasing with interactive mode (
logandrefloglog- Three levels of detail:
--oneline,--stat, and--patch - Reveal branching structure with
--graph - Collapse merge commits with
--first-parent - Filter by changes with the pickaxe options
-Sand-G - Filter by commit message content with
--grep - Restrict time with
--sinceand--until - Sort oldest first with
--reverse - Follow changes to a single file with
--follow - Follow changes to a code block with
-L - Reveal hidden changes in merge commits with
--cc
- Three levels of detail:
reflogreflogbasics- Restore a deleted branch
- Undo a commit amendment
- Undo a rebase
blameandbisectblameblamebasics- Blame a code block with
-L - Ignore mass-change commits with
blame.ignoreRevsFile - Ignore code copying with
-C(-C -C)
bisectbisectbasics- Mark a commit as untestable with
git bisect skip - Automate testing with
git bisect run - Automate testing of performance regressions
worktreeworktreeworktreebasics- Using a worktree to write a hotfix
- Outroduction
- Honourable mentions
- Git features
- Extra tools
- Just for fun
- Further reading
- Git updates
- Git under the hood
- Thank you
- Honourable mentions
One summary email a week, no spam, I pinky promise.
Tags: git