I want to have a file, let's call it "scratchpad", that:
1) is included in repo, so that everyone cloning the repo will receive a copy of the file, it's "initial" version
2) is ignored by git, so that any local changes made to it are not committed and doesn't even pop up on "changed" list
3) is not updateable by git, so that any local changes are safe from overwrite during pull and merge
First requirement can be accomplished by adding the file to git. Second one is doable via git --assume-unchanged
as described here: Git: Ignoring Version-Controlled Files
I can't fulfill the 3rd requirement. The --assume-unchanged
have consequences: as git thinks the file is unchanged, it's free to replace its contents at will. So the local edits aren't safe.
(There is a reason for this madness: this file is supposed to contain various developer-specific data, including his/her login and password. Certainly such data should never appear in the repository. However everyone cloning the repo SHOULD be provided with a set of test credentials. This "scratchpad" file contains several constants and methods, so the project won't even compile without it.)