Git for Windows with TFS and SSL behind a proxy

How to configure git for windows to work with SSL and a corporate certificate, and how to configure git proxy settings to work with local and remote repositories.