I have some secure key files which need to be committed only to the staging branch. But I need to ignore them in all the other branches.
In here Using git, how do I ignore a file in one branch but have it committed in another branch? it shows how to commit in one branch and ignore in another. It didn't work for me. I want to commit in one branch and ignore in all the others. How can I do that?