Hasty Briefsbeta

Using Git add -p for fun (and profit)

5 days ago
  • #workflow
  • #git
  • #version-control
  • git add -p allows interactive staging of code changes (hunks) instead of entire files.
  • Key commands in git add -p: y (accept), n (decline), s (split), a (accept all remaining), d (decline all remaining).
  • git add -p works best for larger projects; may struggle with small files or one-off scripts.
  • LazyGit is a TUI frontend that simplifies the git add -p process by staging hunks by default.
  • Future workflow improvements may include exploring git rebase -i for better commit management.