3 ms·
None of this implies committing untested code. The index is not a commit; it is a pre-commit staging area. When you use 'git add -p', you are adding hunks to th
by msbarnett 14y ago
None of this implies committing untested code. The index is not a commit; it is a pre-commit staging area. When you use 'git add -p', you are adding hunks to the staging area, not committing them.
What's the difference? When you're done staging your patch, you can then check out the staging area and run unit tests on it prior to promoting it to a commit. Doesn't compile? Tests fail? Restage as necessary.
- Myrmornis 14y agoReally? I'd definitely commit before running tests. You can always use reset to redo the commit later. Branches are cheap, commits are cheap.