Go to Tools Options ->Source Control -> Environment, and check option
"Check in everything when closing a solution or project"
Thanks,
-Huizhong