All Scenarios
✂️Enterprise

Split a Commit for Review

A reviewer asks for smaller commits. Undo the commit and re-stage it hunk by hunk with git add -p.

6 minutes
Hard
8 steps
YOUR FILES — ONE FILE, THREE PLACESWorking diryour diskStagingnext commitHEADlast commitadd ›commit ›GITUALIZEYOUR REPOSITORY — .git on your laptop648cab3Add cart functions648cab3b1dd786c28548cd1aadff2b95595fca3e Add cart functions2e039acAdd homepage2e039ac897849007af489a58ee9eec107a21974e Add homepageb272b3aSet up projectb272b3abaca08f2f1c56c0562679f66a61035535 Set up project129c2dbInitial commit129c2db06bfe68f8469dc82e6e05d1c03d1f768c Initial commitmainmain: a movable label on a commitHEADHEAD → the branch you are onREADME.mdunchangedapp.jsunchangedindex.htmlunchangedv1v1v1v2v2v2v2v2v2HEAD → main → 648cab3 “Add cart functions”
0.0s / 99s
commitring = the commit HEAD is onunreachable (still exists)branch = movable labelorigin/* = your bookmark of the remoteHEAD = where you are