You can just not git add the one file on the secondary drive when it is not connected. This schould not be that much overhead and (at least for me) it is much simpler than any other solution. Ps: Why do you want that one config file on the external drive and not on the main one?
As someone who used Prolog in an academic circumstance for more than just logic, i fully agree with that article.
But i still think C++ has more footguns than Prolog.