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
Maybe you want to "pretend" that the file hasn't changed when actually it did? You can do that like this:
git update-index --assume-unchanged file.txt
To undo this later:
git update-index --no-assume-unchanged file.txt
To view a list of files that are marked this way:
git ls-files -v | grep '^[a-z]'
UPDATE
As comments have pointed out, this is most probably NOT what you want to do. A better answer has been posted by @Tom Auger, use that instead.