Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I didn't know about `git add -p`. Really useful!

  -p, --patch
  Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.


I always custom-select hunks of my current work to assemble into coherent commits, where possible. I find it really helps me to rearrange the work I've done in my head in such a way that if I needed to walk someone through it, I could do so by walking the commit line.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: