kassie kassie - 8 months ago 58
Git Question

How to ignore existing file in Git?

I need to work on

locally and in Git, with different content and not to see working copy changes. Is this possible? Is so, how?


Actually, you want --skip-worktree, not --assume-unchanged. Here's a good explanation why.

So git update-index --skip-worktree file.txt

TLDR; --assume-unchanged is for performance, for files that won't change (like SDKs); --skip-worktree is for files that exist on remote but that you want to make local (untracked) changes to.