Re: Fwd: Why does git-status suggest different commands to unstage files depending on whether there is a commit yet or not?
From: Johannes Sixt <hidden>
Date: 2025-09-18 06:57:04
From: Johannes Sixt <hidden>
Date: 2025-09-18 06:57:04
Am 16.09.25 um 23:51 schrieb Anselm Schüler:
[...] I would’ve assumed git-rm simply removes the file and “writes” that removal to the staged changes. This seems to be what y’all are describing. But with that suggestion, I was confused, because I assumed git-rm there would be equivalent in some sense to git-restore in a repository with commits.
You seem to think that `git rm` removes a *change*. This leads me to
believe that you think of commits as a set of *changes*. But this is the
wrong mental model. A commit is a complete state of the project, and the
index ("stage") is the complete project state that is going into the
next commit. `git rm` removes a file, not a change.
-- Hannes