git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* What's the use case for committing both the freshly created file and it's exclusion in .gitignore?
@ 2018-08-09 11:04 Bartosz Konikiewicz
  2018-08-09 19:58 ` Jeff King
  2018-08-10 21:56 ` brian m. carlson
  0 siblings, 2 replies; 5+ messages in thread
From: Bartosz Konikiewicz @ 2018-08-09 11:04 UTC (permalink / raw)
  To: git

Hi there!

I hope that the subject of my message (i.e. the question) is
exhaustive enough, so I'll just stick to reproducing my issue.

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-08-10 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-09 11:04 What's the use case for committing both the freshly created file and it's exclusion in .gitignore? Bartosz Konikiewicz
2018-08-09 19:58 ` Jeff King
2018-08-10  1:12   ` Jonathan Nieder
2018-08-10 10:19     ` Bartosz Konikiewicz
2018-08-10 21:56 ` brian m. carlson

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).