Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tomdeakin
· 14y ago · 0 comments
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.
Comments
[–]
telemachos
14y ago
Another 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
[–]
pja
14y ago
You can also git-add -i to go through the staging area & stage/unstage individual patches.
[–]
jedbrown
14y ago
Or 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
14y ago
you can use git gui (included) for a mouse-friendly way of doing this.
[–]
Kiro
14y ago
Since I first tried the Git GUI I can't see myself using Git Bash ever again (and this article reminds me of why).
[–]
raju
14y ago
If you are on a mac, Gitx works nicely too. You can see each file, and state "hunks" as you go.