In order to avoid checking in connection strings and other sensitive configuration information to Github I use the following approach:
Check your config file in with blank or dummy values then run:
git update-index --assume-unchanged [fileName]
Git will then stop monitoring changes to that file allowing you to put the real config info into it without fear of checking it in.
If you later make changes that you DO want to check in you can run:
git update-index --no-assume-unchanged [fileName]
But obviously make sure you blank out the sensitive information before checking in, and re run the assume-unchanged command afterwards.