Difference between reset --soft and --mixed

dvcs, git

Solution

If you're using a `.gitignore` which is not checked into the repo or changed between the commits, you won't be able to add ignored files from a mixed reset except as manually, neither will `git diff` or `git status` show you they are there.

With a soft reset, everything you had reset will be guaranteed to be included into the commit should you make one.

Actually, either of those might be the way you need, that's why both methods (and explicit access to the index itself) are there in GIT.

Problem

I'm new to GIT, and trying to understand the difference between `git reset --soft` and `git reset --mixed`. I know the latter resets the index, while the former does not, but I'm trying to understand what the material difference is: when would I use one versus the other? I've read this Stack Overflow post, which seems to suggest that `mixed` lends itself to making some changes before re-committing, while `soft` lends itself to simply re-committing immediately. I'm using SourceTree, with the staging pane turned off, and struggling to see why this is so; I can't for the life of me see any actual real differences. The only difference I can see is that a newly added file that I reset over shows up as added with a soft reset, but not so with mixed. But in either case I can successfully make changes to the newly added file, and re-commit. And of course any new changes I make to existing files get seamlessly added to my current un-committed changes, ready to be committed. Do I have to use the Staging Pane with Source Tree to see any practical difference, or am I just missing something? To be clear, with how I have the tool set up now, I see un-committed changes, which I commit in one step.

Original source

Related problems