If you want to stop tracking a file that you commited ages ago (thus not worth fixing with a git rebase), you want to run:
git rebase
git rm --cached $FILE
Sources: [1]
Published on May 16, 2023.
Application for screen casting on Linux
A digital laboratory notebook
A simple environment manager for toolbx