In Visual Studio 2015, using bower, my package restores fail when behind a firewall with an error similar to:
ECMDERR Failed to exec
Microsoft's version of git that is installed (at least with VS2015 Update 1) does honor the .gitconfig file, but the tooling that is installed by default does not give you a way to manipulate it (like all the other answers show using git config to fix the problem).
To fix the problem without any extra installations and whatnot, simply create a .gitconfig file in C:\Users\YourUserName and put this content in there (which is the content that git config --global would do but since you dont have a git.exe that can change config, you cannot use that without installing something else you do not really need)
[url "https://github.com/"] insteadOf = git@github.com: [url "https://"] insteadOf = git://