I try to add a temporary-but-not-so-temporary file to a Git repository without adding it to the index. I don’t want to add it to a .gitignore nor to a file like ~/.gitignore_global because it would just apply for a specific repository.
Is there any way to ignore a file to be indexed in a specific repository without indexing the very fact that I want to ignore it ?
You can place the ignore patterns in
$GIT_DIR/info/excludeso that it will be applicable to only the repo and not every repo.From the manual: