3 ms·
> You do that with a sequence of "git add -p" and "git commit" commands. You can do that with git commit -p.
by masklinn 5y ago
> You do that with a sequence of "git add -p" and "git commit" commands.
You can do that with git commit -p.
- bonzini 5y agoTrue but there's usually a "git diff --staged" in the middle to check what I am committing.
- cryptonector 5y agoExactly!
- masklinn 5y agoYou can do that with “git show HEAD” (and “git commit --amend -p”).
- cryptonector 5y ago`git diff --staged` is superior. For one, you get all the options to `git diff`. For another, it has no side effects, unlike `git commit --amend -p`.
- masklinn 5y ago> `git diff --staged` is superior. For one, you get all the options to `git diff`. Most of which you can get on git show at least if they're relevant to “what have I added”. And of course you can also use git diff on commits if you need something super specific. > For another, it has no side effects, unlike `git commit --amend -p`. … “git commit --amend -p” is the replacement for subsequent “git add -p”, as the GP was talking about a workfliw where they’d intersperse staging stuff and looking at what they’d staged.