I have a problem that's almost identical to this one. The only difference being that I'm not sure what Mercurial is, and I'm just using Git. In my repository is an empty .htpasswd
file that should remain empty on the remote repository, but locally should be given a username and password value.
My .gitignore
contains the following line:
.htpasswd
So in theory it should ignore my file, right? But that is not what's happening in my case. When I change anything in this file, my Git will still recognize this file as changed, and add it to the list of unstaged changes. I want to prevent this from happening. How can I achieve that?
EDIT: I consider the solution in the linked question as a last resort. Since I'm not sure how similar (or not) Mercurial is to Git, I'm wondering if there is a better solution available for Git.