First find the version you are using for GIT.
using this command : git --version
if you have a newer version than 1.7.10.
Then simply use this this command.
Windows:
git config --global credential.helper wincred
MAC
git config --global credential.helper osxkeychain