On Thu, Aug 09, 2018 at 01:04:43PM +0200, Bartosz Konikiewicz wrote: > Steps to reproduce: > > 1. Create a new file. > 2. Stage the file. > 3. Add the file to .gitignore. > 4. Stage the .gitignore. > 5. Commit changes. > > I imagined that the file would now be removed from the stage (because > it's ignored now and not yet committed) but it isn't. Where this > behavior would be desirable? I know that a 'git add' command can be > invoked with an '-f' flag, which would yield the same result, but I > can't come up with an explanation where can it be applied. Let me give you one. If you use pristine-tar to check in the contents of an upstream tarball, upstream may have included both a .gitignore file and one or more ignored files in their tarball (say, something autoconf generated). Both of those files will be required in order to reproduce the tarball, so git add -f or multiple stages of add will need to be used. If we unstaged the files from the index when the .gitignore was added, this workflow wouldn't be possible. -- brian m. carlson: Houston, Texas, US OpenPGP: https://keybase.io/bk2204