I find the jetbrains IDEs (like Webstorm) has the best UI interface for this. Selectively commit specific lines from your changes.
Using Git add -p for fun (and profit)
21–30 of 80 posts
Re: Using Git add -p for fun (and profit)
#22Re: Using Git add -p for fun (and profit)
#23Re: Using Git add -p for fun (and profit)
#24How do people handle that? One way would be to follow it up with git stash, running tests, and, if necessary, git amend, but that can get cumbersome soon.
Re: Using Git add -p for fun (and profit)
#25 git commit --verbose --patchRe: Using Git add -p for fun (and profit)
#26for one, it lets me create small patches of related stuff. There's nothing wrong with major patchsets in general but it makes it harder to cherry-pick little fixes to old stable branches for example
two, I notice other developers making me do the work for them because crap sneaks into their commits, like debugging statements or accidentally removed hunks. Instead I have to do "git add -p" when reviewing their commit.
Essentially, it's a first pass staging area you can review what you did. beautiful.
Re: Using Git add -p for fun (and profit)
#27Re: Using Git add -p for fun (and profit)
#28Re: Using Git add -p for fun (and profit)
#29A disadvantage of git add -p is that it allows you to create a commit that never existed on the development system, and, hence, cannot have been tested. How do people handle that? One way would be to follow it up with git stash , running tests, and, if necessary, git amend , but that can get cumbersome soon.