How can I tell git (or some other dvcs) to track a file privately?

My use case starts from something a lot like this; a team uses a central repository (in my case it is subversion, but I believe if it were git the issue would be the same), and some of the files are member-private (Django local settings files, IDE private project preferences etc). While the private file should remain private -- that is, I don't want changes I make to it to be pushed or dcommitted -- I do want the file tracked and version controlled.

The best option would be a way to keep the file private by default; a workaround would be a way to keep private commits -- having to remember to commit the private file separately would be a nuisance, but still better than not being able to track it at all.

In comparison to suggested solutions: this and this aren't good because they prevent the file from being committed at all; this is not what I want. I want it committed locally; I just don't want it published.

BTW -- while I love DVCSs, and git has been a sort-of default, I don't feel particularly committed to it (pun unintended); if only hg or bzr can do this, it may be reason enough for me to switch.

5
задан Community 23 May 2017 в 12:29
поделиться