GIT-ABSORB(1)

πŸ’… git-absorb β€” the manual, but make it make sense

okay so bestie, welcome to the git absorb page β€” that's the git absorb manual, section 1, and honestly? it's a whole vibe. let's get into it ✨


🌸 NAME

git-absorb β€” automatically absorb staged changes into your current branch 🫢


πŸ¦‹ SYNOPSIS

git absorb [FLAGS] [OPTIONS]

πŸ’– DESCRIPTION

okay imagine this: you've got a feature branch with a few commits. your teammate reviews it and is like "hey bestie, a couple bugs" 😭. you fix them β€” iconic β€” but now what? you do NOT want to shove all those fixes into one opaque commit literally called fixes, because you believe in atomic commits. periodt. πŸ’…

so instead of manually hunting down commit SHAs for git commit --fixup, or running a manual interactive rebase (exhausting, lowkey), you do this:

$ git add $FILES_YOU_FIXED

$ git absorb --and-rebase
  (or)
$ git absorb
$ git rebase -i --autosquash master

git absorb will automatically figure out which commits are safe to modify, and which indexed changes belong to each of those commits. then it writes fixup! commits for each of those changes. main character energy fr. πŸ”₯

you can check its output manually if you don't trust it (fair, honestly), and then fold the fixups into your feature branch with git's built-in autosquash functionality. ate. πŸ‘‘


✨ FLAGS ✨

  • -r, --and-rebase β€” run rebase if successful. also see the REBASE_OPTIONS below, iykyk πŸŽ€
  • -n, --dry-run β€” don't make any actual changes πŸ™ˆ
  • --no-limit β€” remove the absorb stack limit. has no effect when used with --base

this will consider all commits until either root, merge commit, or a commit by another author (unless --force-author is used)

which is why you should be careful when using this flag ⚠️ genuinely, be careful.

  • --force-author β€” generate fixups to commits not made by you πŸ‘€
  • --force-detach β€” generate fixups even when on a non-branch (detached) HEAD πŸŒ€
  • -F, --one-fixup-per-commit β€” only generate one fixup per commit
  • -f, --force β€” skip all safety checks as if all the --force-* flags were given. see those flags to understand the full effect of supplying --force πŸ’€ (yes, the whole effect. go read them.)
  • -s, --squash β€” create squash commits instead of fixup commits.

when this flag is used, "fixup commit" may be read as "squash commit" throughout the documentation. all configuration relating to fixup commits will apply to the squash commits instead. 🧚

  • -w, --whole-file β€” match the first commit touching the same file as the current hunk. use this with care! ⚠️
  • -h, --help β€” prints help information
  • -V, --version β€” prints version information
  • -v, --verbose β€” display more output πŸ—£οΈ

πŸŽ€ OPTIONS πŸŽ€

  • -b <base>, --base <base> β€” use this commit as the base of the absorb stack
  • -m <MESSAGE>, --message <MESSAGE> β€” a simple commit message body that will be used for all generated fixup commits. ✍️
  • --gen-completions <SHELL> β€” generate completions [possible values: bash, fish, nushell, zsh, powershell, elvish] 🌈
  • -- <REBASE_OPTIONS> β€” options to pass to git rebase after generating commits. must be the last arguments and the -- must be present. only valid when --and-rebase is used. 🫢

πŸ¦‹ USAGE

  1. git add any changes that you want to absorb. by design, git absorb will only consider content in the git index.
  2. git absorb. this will create a sequence of commits on HEAD. each commit will have a fixup! message indicating the message (if unique) or SHA of the commit it should be squashed into. ✨
  3. if you're satisfied with the output, git rebase -i --autosquash to squash the fixup! commits into their predecessors. you can set the GIT_SEQUENCE_EDITOR environment variable if you don't need to edit the rebase TODO file. πŸ’…
  4. if you're not satisfied (or if something bad happened 😭), git reset --soft PRE_ABSORB_HEAD to the pre-absorption commit to recover your old state. (you can also find the commit in question with git reflog.) and if you think git absorb is at fault, please file an issue. 🫢

πŸ’œ CONFIGURATION

πŸ“ STACK SIZE

when run without --base, git-absorb will only search for candidate commits to fixup within a certain range (by default 10). if you get an error like this:

WARN stack limit reached, limit: 10

edit your local or global .gitconfig and add the following section:

[absorb]
    maxStack=50 # Or any other reasonable value for your project

stack size can also be disabled temporarily for one command (see --no-limit) πŸ‘‘

🌸 ONE FIXUP PER FIXABLE COMMIT

by default, git-absorb will generate separate fixup commits for every absorbable hunk. to always generate only 1 fixup commit for all hunks that absorb into the same commit, edit your local or global .gitconfig and add the following section:

[absorb]
    oneFixupPerCommit = true

🧚 AUTO-STAGE ALL CHANGES IF NOTHING STAGED

by default, git-absorb will only consider files that you've staged to the index via git add. however, sometimes one wants to try and absorb from all changes, which would require to stage them first via git add .. to avoid this extra step, set

[absorb]
    autoStageIfNothingStaged = true

which tells git-absorb, when no changes are staged, to auto-stage them all, create fixup commits where possible, and unstage remaining changes from the index. πŸŽ€

⭐ FIXUP TARGET ALWAYS SHA

by default, git-absorb will create fixup commits with their messages pointing to the target commit's summary, and if there are duplicate summaries, will fall back to pointing to the target's SHA. instead, can always point to the target's SHA via:

[absorb]
    fixupTargetAlwaysSHA = true

πŸ’€ GENERATE FIXUPS FOR COMMITS NOT AUTHORED BY YOU

by default, git-absorb will only generate fixup commits for commits that were authored by you. to always generate fixups for any author's commits, edit your local or global .gitconfig and add the following section:

[absorb]
    forceAuthor = true

πŸŒ€ GENERATE FIXUPS ON DETACHED HEAD

by default, git-absorb will not generate fixup commits when HEAD is not a branch ("is detached"). to always generate fixups on detached HEADs, edit your local or global .gitconfig and add the following section:

[absorb]
    forceDetach = true

πŸ”₯ GENERATE SQUASH COMMITS INSTEAD OF FIXUPS

by default, git-absorb will generate fixup commits. to instead generate squash commits, edit your local or global .gitconfig and add the following section:

[absorb]
    createSquashCommits = true

when this option is set, "fixup commit" may be read as "squash commit" throughout the documentation. all configuration relating to fixup commits will apply to the squash commits instead. 🧚


🌈 GITHUB PROJECT

https://github.com/tummychow/git-absorb


πŸ‘‘ AUTHOR

Stephen Jung <tummychow511@gmail.com>


and that's the whole page bestie, no cap πŸ’–

okay so this was git-absorb, dated 03/07/2026, manual page GIT-ABSORB(1) β€” go forth and absorb, you absolute icon, mwah πŸ«ΆπŸ’…βœ¨

πŸ“¦ where this page comes from