3 ms·
Use the -p (--patch) flag, it works wonderfully for selectively marking blocks for staging (git add -p), and selectively checking out changed files with (git ch
by joaomsa 12y ago
Use the -p (--patch) flag, it works wonderfully for selectively marking blocks for staging (git add -p), and selectively checking out changed files with (git checkout -p).
- michaelmior 12y agoMy experience is that you'll quickly get burned if you do this for the use case the OP mentioned. The goal is to keep different settings for a development environment, not to just temporarily avoid committing. One day, you'll inevitably forget and accidentally commit and push the changes you've been carefully avoiding.
- JamesSwift 12y agoI've not had that experience at all. For the times you know it would be tedious to add/ignore all diffs manually, you can just use the 'a' or 'd' commands to add or ignore for the remainder of the current file. I much prefer using 'add -p' every single time I commit.
- michaelmior 12y agoThen you've been lucky. Although if you show others on your team this approach, I think something bad is guaranteed to happen eventually.