Add ignored file to repo but don't track afterwards

I don't think it is intended nor possible via git.

I would recommend to hierarchically load the paraemter files. You either load parameters.file or, if not existing, paramters.default.file. The paramters.default.file is kept in git, whereas the parameters.file is ignored.

Users who want to adapt the parameters need to create a file parameters.file for that purpose (alternatively you can automate the process during some make/setup process).


It looks like there's been a new feature added to support this kind of scenario

git update-index --skip-worktree <file>

Source: https://stackoverflow.com/a/20241145/2436737
More info: Git - Difference Between 'assume-unchanged' and 'skip-worktree'

Tags:

Git