Gabriele Filaferro
03/25/2026, 3:25 PMbranch-a, branch-b, branch-c
• I am checkout to branch-b which has 2 commits, commit-2a and commit-2b
• I have staged changes and I want to add them to the first commit commit-2a but the last commit is commit-2b
Is there a way to do it with the Graphite CLI, maybe using the gt modify command? How?
Thank you!Pylon
03/25/2026, 3:25 PMPylon
03/25/2026, 6:49 PMgt doesn't directly support amending staged changes into a specific commit within a branch. However, there are two commands to consider for approximating what you're trying:
1. gt absorb — This automatically figures out which commit your changes belong to based on the lines you modified. Run gt absorb -a and it will attempt to amend each hunk into the correct commit (like commit-2a). It will show you a preview before applying.
2. gt modify --interactive-rebase — This starts a git interactive rebase on the commits in your branch, where you can manually reorder, squash, or fixup commits to fold your changes into commit-2a.
gt absorb is the most seamless approach if your changes touch the same lines as commit-2a.
See more in our docs: Working with commitsGabriele Filaferro
03/25/2026, 7:13 PMgt absorb but some changes got left out. I'll try gt modify --interactive-rebase. Thank you!