kassie kassie - 3 months ago 7
Git Question

How to ignore existing file in Git?

I need to work on

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

Answer

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.