Re: Ignored files being silently overwritten when switching branches
- From
Jeff King <peff@peff.net>
- Date
- Oct 16, 2018, 06:40 UTC
- Message-ID
- <20181016064049.GB25933@sigill.intra.peff.net>
- In-Reply-To
- <7d6858c8-aa84-aa05-6c69-22dbbff7dfaa@hibox.tv>
On Mon, Oct 15, 2018 at 01:01:50PM +0000, Per Lundberg wrote:
> Sorry if this question has been asked before; I skimmed through the list > archives and the FAQ but couldn't immediately find it - please point me > in the right direction if it has indeed been discussed before.
It is a frequently asked question, but it doesn't seem to be in any FAQ that I could find. The behavior you're seeing is intended. See this message (and the rest of the thread) for discussion:
https://public-inbox.org/git/7viq39avay.fsf@alter.siamese.dyndns.org/
Show 6 quoted lines
> So my question is: is this by design or should this be considered a bug > in git? Of course, it depends largely on what .gitignore is being used > for - if we are talking about files which can easily be regenerated > (build artifacts, node_modules folders etc.) I can totally understand > the current behavior, but when dealing with more sensitive & important > content it's a bit inconvenient.
Basically: yes. It would be nice to have that "do not track this, but do not trash it either" state for a file, but Git does not currently support that.
-Peff