I need to work on file.txt
locally and in Git, with different content. I want Git not to tell me that there have been changes to that file.
Is this possible?
To ignore untracked files, you have a file in your git folder called . git/info/exclude . This file is your own gitignore inside your local git folder, which means is not going to be committed or shared with anyone else. You can basically edit this file and stop tracking any (untracked) file.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With