27 ms·
git-add -p is new to me, but looks like something I'd wish I'd known about for a long while. The number of times I end up copying changes (like a new function)
by tomdeakin 15y ago
git-add -p is new to me, but looks like something I'd wish I'd known about for a long while. The number of times I end up copying changes (like a new function) into some temp file while I commit is more than I'd care to admit.
- pja 15y agoYou can also git-add -i to go through the staging area & stage/unstage individual patches.
- jedbrown 15y agoOr use git citool or an emacs mode like egg or magit (other editors have similar) that let you conveniently stage by hunk or line.
- baq 15y agoyou can use git gui (included) for a mouse-friendly way of doing this.
- Kiro 15y agoSince I first tried the Git GUI I can't see myself using Git Bash ever again (and this article reminds me of why).
- telemachos 15y agoAnother good post that talks about git add -p is Ryan Tomayko's The Thing About Git[1]. [1]: http://tomayko.com/writings/the-thing-about-git http://tomayko.com/writings/the-thing-about-git
- raju 15y agoIf you are on a mac, Gitx works nicely too. You can see each file, and state "hunks" as you go.